I've created an R package that contains RStudio templates. When the template is used, I want it to copy all files from the skeleton folder to the project folder. The skeleton folder is in the package here:
There are two files:
When the package is compiled, everything in the
inst folder moves up a level, and so this folder is found using:
skeleton_dir <- system.file("rstudio","templates","project","prj_skeleton", package = "my_pkg", mustWork = TRUE)
However, when I inspect this folder after compilation, the
scratchpad.R file is missing.
Does anyone know how to counteract this behaviour? Is it because it is a
.R file and so it cannot be copied over? I have other templates which contain
.Rmd files and these are fine.