Hello, Thanks for suggesting tools::R_user_dir(). I was able to implement and resubmit. This issue prompted me to read the policies thoroughly here - https://r-pkgs.org/release.html .
Best Regards, Krishna Keshav From: Simon Urbanek <simon.urba...@r-project.org> Date: Monday, October 23, 2023 at 3:07 PM To: Keshav, Krishna <kkes...@ufl.edu> Cc: List r-package-devel <r-package-devel@r-project.org>, kurt.hor...@wu.ac.at <kurt.hor...@wu.ac.at> Subject: Re: [R-pkg-devel] Failing to write config file in linux [External Email] From CRAN policy (which you agreed to when you submitted your package) - note in particular the "nor anywhere else on the file system" part and also note that it tells you what to do in your case: 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. For R version 4.0 or later (hence a version dependency is required or only conditional use is possible), packages may store user-specific data, configuration and cache files in their respective user directories obtained from tools::R_user_dir(), provided that by default sizes are kept as small as possible and the contents are actively managed (including removing outdated material). > On Oct 23, 2023, at 5:52 AM, Keshav, Krishna <kkes...@ufl.edu> wrote: > > Hi, > > My package is failing on linux based systems because of an attempt to write > in a location of package. One of the core features that we would like user to > have is to modify the values in the config file, for which package has a > function for user to provide modified config. In future, they should be able > to provide individual parameters for the config for which also we will be > writing to config in package directory /inst/ so that it can later be > fetched. I understand that policy doesn’t allow writing to home directory. Is > there a workaround for this? Or what could be other potential solutions to > explore. > > Snippet – > https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FGarrettLab%2FCroplandConnectivity%2Fblob%2F923a4a0ca4a0ce8376068ee80986df228ea21d80%2Fgeohabnet%2FR%2Fparams.R%23L57&data=05%7C01%7Ckkeshav%40ufl.edu%7C8e20f2cfc4064895404c08dbd3fb5131%7C0d4da0f84a314d76ace60a62331e1b84%7C0%7C0%7C638336848586995860%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=zrjs7IXdoOJU%2BTyAZLUotDP3PGzTexKvDBBXCy10tRo%3D&reserved=0<https://github.com/GarrettLab/CroplandConnectivity/blob/923a4a0ca4a0ce8376068ee80986df228ea21d80/geohabnet/R/params.R#L57> > > Error – > ── Failure ('test-parameters.R:38:3'): Test 6: Test to set new > parameters.yaml ── > Expected `set_parameters(new_param_file)` to run without any conditions. > ℹ Actually got a <simpleWarning> with text: > cannot create file > '/home/hornik/tmp/R.check/r-release-gcc/Work/build/Packages/geohabnet/parameters.yaml', > reason 'Read-only file system' > > > Best Regards, > Krishna Keshav > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-package-devel@r-project.org mailing list > https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-package-devel&data=05%7C01%7Ckkeshav%40ufl.edu%7C8e20f2cfc4064895404c08dbd3fb5131%7C0d4da0f84a314d76ace60a62331e1b84%7C0%7C0%7C638336848586995860%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=LA140Pw6t4xGXGJV60Zedj7CNpkDjsYlTS%2FHSc162fo%3D&reserved=0<https://stat.ethz.ch/mailman/listinfo/r-package-devel> [[alternative HTML version deleted]] ______________________________________________ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel