How to automate R scripts in rstudio?

r

#1

Hi Team,

I have r code file and i want to automate (it has ti run for every 12 hrs) ,
but thing is code has to return the output and it has to save in particular directory.
Can any one help?

I have the .Rmd file and it needs to be knit for every 12 hours also file name should include Sys.Date()-1.

below code i used and getting error :

rmarkdown::render("/home/saisaran/Project-2/Montly report.Rmd", 
                 output_file=sprintf('./DailyReports/LaunchDaily_%s.html', 
                 format(Sys.Date(), format = "%m-%d-%y")))

error

Error: path for html_dependency not found: 

#2

Hi, could you be more specific?

Could you also share a sample code?


#3

I mean there is one Rscript for Annual reports/Monthly reports/Weekly reports included in r code.
when u run the complete code it will generate 5 reports (ggplot2,plotly)

So i want to run the total rscript for every particular time period.


#4

updated the code…pls let me know if u have any idea thanks for the response.


#5

take a look ,


#6

thank u so much for the response @mohamed_d180 :slight_smile:


#7

Did you get this to work? I assume you are using Windows RStudio application and not RStudio server. Are you running your rscripts from r code or using some kind of external software to activate the R Script?


#8

i am using normal r scripts only…and system with ubuntu 18.04 . now its working fine.

Saran