I'm currently creating an R package, and my scripts require before any analysis is done that 3-4 text files be loaded. Normally, I would run the scripts with the following:
library(data.table)
session_data = read.table("/path/name/to/filename.txt")
and then refer to session_data
throughout the analysis.
However, in order to release this as an R package, I believe that these files must be downloaded at the time on the package installation.
When do I load it and assign it to a variable, e.g. session_data
? In a function? In this case, should the function loading the text file be executed about loading the R library, library(package_name)? Is there more appropriate option?