Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solutions for a crowded namespace: selective removal of items? Any better ideas? #1544

Open
vertesy opened this issue Mar 1, 2024 · 0 comments

Comments

@vertesy
Copy link

vertesy commented Mar 1, 2024

Hello,

I use tidyverse, and bc its a dependency for many packages, frankly, it's not really a choice.

The problem

The global namespace often gets crowded with lot's of unneccesary variables.

This is a problem with autocomplete, bc rarely used items, often takes precedence over key base functions, for example

  • typing ta and hit autocomplete should result in table(), but once I load tidyr the default complete becomes table1 which is some random example datset
  • Another example r is pr autocompletes to presidential instead of print().
  • I believe most people use these example datasets much much less frequently then core functions.
  • Such namespace crowding makes autocomplete often useless, thus shaving off minutes every working hour.

Examples

image

image

Looking for a solution

  1. Not loading tidyverse packages is not a reasonable option
  2. I cannot remove by rm(table1), it stays
  3. I can manually overwrite a long list of these with table1 <- NULL, which makes it disappear from the autocomplete list, but they stay in global namespace
  4. How would you deal with this? Do u have a better solution?

What would be a better long term solution

  1. I think many package creators are lenient and spam the workspace (I am no exception). At least the separation of data objects should be loadable independently, such as done for Seurat and SeuratData. For a lack of a better idea, I would like to propose that you separate tidyr and tidyrData, or tidyverseData into separate packages. I use tidyverse every day, I don't think I ever used these data objects.

Thank you for your time!


ps. you can see another bug on the screenshot: displayed package assignment is often wrong (in RstudioServer Desert Rose): prcomp is from stats and not from MarkdownReports.

@hadley hadley changed the title Solutions for a crowded and spammed namespace: selective removal of items? Any better ideas? Solutions for a crowded namespace: selective removal of items? Any better ideas? Mar 14, 2024
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

No branches or pull requests

1 participant