I have a particular R script which I regularly in RStudio to scrape data from the internet. I would like to set up a batch file to run this file automatically and therefore want to run this script directly from R. However, the data frames and objects recognized in RStudio are not recognized in R. I'm no expert in R but have searched this topic but forgive my if I've missed the solution posted elsewhere.
Specifically, when working in RStudio I used getwd()
which returns "C:/Users/mdoucette001/Desktop/Beer Stuff/R Beer Stuff/". I have run save.image()
to ensure that the output (data frames, lists, etc) created in RStudio is being saved. When I try to run this in R, the first line of code I run is setwd("C:/Users/mdoucette001/Desktop/Beer Stuff/R Beer Stuff")
. If I compare data frames in R and RStudio (e.g. nrow(df1) ) I get a different response between the two. Because the R rowcount is smaller, I suspect that it is somehow loading an old image/workspace. What am I missing?