I currently have a data_prep.R file that I use to pull in data using SQL queries and then wrangle the data into suitable data frames for use within my {golem} package. At the end of this script I have
usethis::usedata(df, overwrite = T)
From research it seems that this file should go into the /data-raw folder as you are not supposed to execute code in the /R folder. When ran, it constructs my data frames and then places them within the /data folder. However, this script does not seem to get ran whenever I run the application, moreover, the data frames will remain unchanged until I manually run the data_prep.R script again.
My application relies on the new data coming in and as such I would need this data_prep.R file to run whenever the app is launched.
Is there something that I am missing?