Reputation: 625
Is it possible to call a R program with in a R program?
Say for example, I am looking for something like this:
If condition == X{
CALL "Pgm A"
} else {
CALL "Pgm B"
}
This kind of syntax I have used in C. Is there a way similar in R?
Thank you.
Upvotes: 13
Views: 22845
Reputation: 581
This should do
if(condition==X){
source("program_A.R")
}else{
source("program_B.R")
}
Upvotes: 21