[R-pkg-devel] Inconsistent application of the rule about modifying the user filespace?
Etienne Bacher
et|enne@b@cher @end|ng |rom protonm@||@com
Sat Jul 5 22:49:09 CEST 2025
Dear all,
tl;dr: several CRAN packages can modify the user filespace without
explicitly
requiring the user to specify the path, but I was required to change the
default behavior of some functions in my package because they would
modify the
user's filespace. This seems inconsistent to me (and therefore it's a bit
frustrating), is there a way to clarify it in the policies?
Longer version:
A couple of weeks ago, I submitted a package, flir [0], that provides
several functions that write to the user directory (it is now on CRAN). For
instance, `setup_flir()` creates a folder "flir" in the working
directory, and
`fix()` parses all R files in the working directory and potentially
modifies
them following a list of predefined rules. The behavior of those
functions was
clearly documented.
Those functions had an argument `path = "."` by default. During the
submission
process, I got a comment indicating that I had to remove this
default value and force users to specify a value for `path` instead (or
interactively handle it if it is missing), which is a bit annoying simply
because it forces extra typing. This comment was referring to the following
paragraph from CRAN policies:
"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."
I understand the willingness to minimize automatic changes to the user's
file system, but it seems to me that this rule is not consistently
applied. There
are plenty of functions from external packages that directly write to
the user's
file system without specifying a path and without obtaining confirmation
from
the user, such as `altdoc::setup_docs(), `pkgdown::build_site()`,
`Rcpp::Rcpp.package.skeleton()`, `roxygen2::roxygenize()`, most of `usethis`
functions, etc.
Therefore, it's quite unclear to me why removing the default `path =
"."` was
required in this case. Does this depend on who reviews the submissions? Is
there a way to clarify it in the policies?
Best,
Etienne
[0]: https://cran.r-project.org/web/packages/flir/
More information about the R-package-devel
mailing list