Alex Bădoi Alex Bădoi - 12 days ago 5
R Question

How can i schedule an R code to run without having my PC on? [web-hosting]

I am wondering if it's possible to have relatively simple R code pull and feed data into say... a text file attached to an email without having to keep my PC on.

I have a web-scraping code here that use:

library(XML)
library(stringr)


to scrape some web data which i would like to save daily..

Putting that on a loop that runs every 24 hours would be relatively easy, but i don't want to keep my PC on or not able to use the R environment while this is running.

what are my options?

Answer

Suggest you spin up an AWS EC2 instance and set the script to run as a cron job on a daily basis.

Here's some resources: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html

http://www.louisaslett.com/RStudio_AMI

http://strimas.com/r/rstudio-cloud-1

Requires a little bash but if you aren't familiar it's definitely worth learning.

Comments