Question: Essentially, I have constructed a sizable predictive model in R with about 10~15 separate script files for collecting, sorting, analyzing and presenting my data. Rather than just put everything into one gigantic script file, I would like to maintain some level of modularity and run each piece from a control script, or some kind of comparable control mechanism, as I've done in matlab before. Is this possible in R?

I have read this thread as well as its related threads, but couldn't find this exact answer.
[Organizing R Source Code](https://stackoverflow.com/q/2284446/761313)

Answer: 
I think you're simply looking for the `source` function. See `?source`. I often have a master script which `source` other `.R` files.
I am a new developer and I am answering with an example that worked for me because no one has given an example. Example of using source("myscript.R"), to call another R script "myscript\_A.R" or "myscript\_B.R" is as follows-

```
if(condition==X){
    source("myscript_A.R")
}else{
    source("myscript_B.R")
}

```