I'm developing a package in R (3.3.2) that has internal data. The data is added to ./R/sysdata.rda via
devtools::use_data(dataset, pkg = 'pkgName', internal = TRUE, overwrite = TRUE)
Within the package I've added and exported a simple function:
show.R
show = function() {
print(dataset)
)
I'm installing the package locally:
devtools::install(pkg = 'pkgName',
args = paste('--library=', installLocation, sep = ''),
reload = TRUE,
local = FALSE)
Finally, I can call show without problems:
library(pkgName, lib.loc = installLocation)
show()
# ...output as expected
I'm running into trouble when I change the data in sysdata.rda. No matter what I try the ONLY way I can get the new data to load from the installed package is on the initial library() load after I restart R.
I have tried:
detach('package:pkgName', unload = TRUE)
unloadNamespace(pkgName)
remove.packages(pkgName, lib = installLocation)
I have also confirmed that the data in the source location has updated:
load(sysdata.rda) # looks good
Where does internal sysdata get cached and how can I clear it or at least force a refresh?