Assuming your script is named "myScript.r", you can use something like source("myScript.r", echo = TRUE) to run the entire script.
source("myScript.r", echo = TRUE)
548k questions
547k answers
4 comments
86.3k users