Skip to content

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

Closed
@vertesy

Description

@vertesy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions