I am creating an Rscript that will run every 30min via the taskscheduleR package. However, there are variables that need to be updated every 30 min and some variables that should only be updated once a week. I would like the variables that are part of the weekly scheduling to still be in the global environment. For example
#Define a variable x that gets run once per week.
x = 10
#Define a variable y that gets run every thirty minutes.
y = x*5
print(y)
It seems I might need 2 scripts where the first script I write the data to a csv and then read it in on the script that runs every 30 min. I was wondering if there was a way to do this all on one script thank you.
#script_OnceAweek.R
x = 1:10
write.csv(x, "file.csv")
#script_Every30min.R
k = read.csv("file.csv")
y = k*5