0

I'm wondering if there is a way to run rscript within another script? like we do in Java

For example:- I have script-A, and script-b, so when I run script-b it should run script-a first automatically.

jai
  • 41
  • 5
  • 1
    Call `source("script-a.R")` from near the top of script-b. But see the cautions in https://stackoverflow.com/questions/42815889/r-source-and-path-to-source-files – wibeasley Feb 11 '19 at 14:30

1 Answers1

0

You can use the source() function to run code in another file. So at the top of your script-b, just put source('path/to/script-A.R').

C. Braun
  • 5,061
  • 19
  • 47