How do I call functions defined in abc.R file in another file, say xyz.R?
A supplementary question is, how do I call functions defined in abc.R from the R prompt/command line?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can call
source("abc.R")followed bysource("xyz.R")(assuming that both these files are in your current working directory.If abc.R is:
and xyz.R is:
then this will work:
Even if there are cyclical dependencies, this will work.
E.g. If abc.R is this:
and xyz.R is this:
then,