Does CRAN allow a package to copy templates into user's project directory?

I am developing a package that copies templates and creates files inside the user's project directory. More specifically, it can create a folder and automatically fills it with a few template files. It also allows the user to add files in this folder.

Basically, this is similar to what {usethis} does (helpers to create files more quickly, etc.). But when I check the steps to follow to prepare a package for CRAN (see here), I see that:

Packages should not write in the user’s home filespace (including clipboards), nor anywhere else on the file system apart from the R session’s temporary directory (or during installation in the location pointed to by TMPDIR: and such usage should be cleaned up). Installing into the system’s R installation (e.g., scripts to its bin directory) is not allowed.

{usethis} is on CRAN, so I suppose that what my package does is allowed, but this paragraph makes me doubt. I don't want to contribute to the saturation of CRAN team's checks, so I prefer asking here: do you know if my package's behavior is allowed by CRAN?

The full quote from the CRAN repository policies may clarify this (emphasis mine).

Packages should not write in the user’s home filespace (including clipboards), nor anywhere else on the file system apart from the R session’s temporary directory (or during installation in the location pointed to by TMPDIR : and such usage should be cleaned up). Installing into the system’s R installation (e.g., scripts to its bin directory) is not allowed.
Limited exceptions may be allowed in interactive sessions if the package obtains confirmation from the user.

Calling a function whose main purpose is to setup a project implies consent, so it is consistent with CRAN's policies.

The main thing you need to avoid is that none of your package's tests or examples should write anywhere except inside the R sessions temp directory (e.g. what you get from tempdir()).

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.

Thank you, it's much clearer