Skip to content

prompt before removing packages from non-project libraries#2337

Merged
kevinushey merged 2 commits into
mainfrom
feature/remove-prompt
Jul 15, 2026
Merged

prompt before removing packages from non-project libraries#2337
kevinushey merged 2 commits into
mainfrom
feature/remove-prompt

Conversation

@kevinushey

Copy link
Copy Markdown
Collaborator

Closes #2331.

Changes

  • renv::remove() gains a prompt argument (default interactive()), and now asks for confirmation before removing packages from a library other than the project library -- for example, when called without an activated renv project, where the target library would be the user library. No prompt is shown when removing from the project library itself.
  • Documents that a package's record can be removed from the lockfile by setting it to NULL, e.g. renv::record(list(dplyr = NULL)), with cross-references between remove() and record() clarifying that the former modifies only the library and the latter only the lockfile.

Tests

  • New test-remove.R covering removal from the project library, prompt accept/decline behavior for non-project libraries, and that no prompt is shown for the project library.
  • devtools::test(filter = "remove|record"): 54 passed.

@kevinushey
kevinushey merged commit eb8b9b7 into main Jul 15, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

renv::remove() uninstalls R packages from global .libPath()

1 participant