Re: [R-pkg-devel] Removing packages files

2025-01-08 Thread Vladimir Dergachev
Hi Lluís, Just wanted to add to the discussion that it would be good to consider users that are disconnected or behind a firewall and are installing the package from file. An option to point the package to a separately downloaded file would be useful. best Vladimir Dergachev On Thu,

Re: [R-pkg-devel] Removing packages files

2025-01-03 Thread Lluís Revilla
The data is mostly CRAN's own files transformed, I don't expect the download to be problematic on CRAN's checks. The R core members made the functionality inside tools to use a local variable to search for the requested file locally. Only if the file is not found they are downloaded from the intern

Re: [R-pkg-devel] Removing packages files

2025-01-03 Thread Dirk Eddelbuettel
On 2 January 2025 at 13:41, Henrik Bengtsson wrote: | Agree, it would be neat if a package could clean up after itself when | uninstalled. Indeed many things could be nicer if we had more package manager integrations and hooks besides `cleanup` and `configure`. Someone would have to start with

Re: [R-pkg-devel] Removing packages files

2025-01-03 Thread Duncan Murdoch
On 2025-01-03 10:04 a.m., Lluís Revilla wrote: Thanks Henrik for confirming there is nothing similar currently. Duncan: Letting the user choose when to remove the folder/data at will is easy. I was trying to ensure that the system is clean after removing the package. Thanks. No, I was suggesti

Re: [R-pkg-devel] Removing packages files

2025-01-03 Thread Lluís Revilla
Thanks Henrik for confirming there is nothing similar currently. Duncan: Letting the user choose when to remove the folder/data at will is easy. I was trying to ensure that the system is clean after removing the package. Thanks. On Thu, 2 Jan 2025 at 22:42, Henrik Bengtsson wrote: > > As a first

Re: [R-pkg-devel] Removing packages files

2025-01-02 Thread Henrik Bengtsson
As a first step, this sounds like something for the 'tools' package, e.g. tools::cleanup_R_user_dir() that wipes package subfolders of packages no longer installed, or the specified package, iff given. With that in place, one could argue for adding a 'cleanup' argument to remove.packages() that use

Re: [R-pkg-devel] Removing packages files

2025-01-02 Thread Duncan Murdoch
Sorry, I misunderstood what you are after. I thought you only wanted to keep it for the duration of a session. I don't think there's a way to keep a file beyond the current session, but uninstall it later when the package is uninstalled. I think the way you should handle this is to offer a f

Re: [R-pkg-devel] Removing packages files

2025-01-02 Thread Lluís Revilla
Dear Duncan, Thank you for your answer. I checked again and made a mock package that removes a file with .onDetach. The file was not removed upon uninstalling the package. Lluís On Thu, 2 Jan 2025 at 17:23, Duncan Murdoch wrote: > > On 2025-01-02 9:55 a.m., Lluís Revilla wrote: > > Hi list, > >

Re: [R-pkg-devel] Removing packages files

2025-01-02 Thread Duncan Murdoch
On 2025-01-02 9:55 a.m., Lluís Revilla wrote: Hi list, I am developing a package that will download some data, and I'd like to store it locally to not recalculate it often. The CRAN policy requires tools::R_user_dir to be used and "the contents are actively managed (including removing outdated m

[R-pkg-devel] Removing packages files

2025-01-02 Thread Lluís Revilla
Hi list, I am developing a package that will download some data, and I'd like to store it locally to not recalculate it often. The CRAN policy requires tools::R_user_dir to be used and "the contents are actively managed (including removing outdated material)" or using TMPDIR but "such usage should