0

When you start RStudio it's common to find variables you didn't create.
That happen even if you cleared all the objects before closing and saving the last session.
I guess that variables are loaded automatically by some user installed package. And it can be annoying to have your workspace plenty of strange things.

How can I know where that object comes from?

For example, since several weeks ago I have a variable called summa containing a vector of 417 elements.

skan
  • 7,423
  • 14
  • 59
  • 96
  • 1
    Do you have any `.RData` objects in your working directory? ..because if you do have them there, RStudio will load them into your Global Environment when starting up.. Where do these variables pop up? In the Global Environment? – symbolrush Oct 19 '16 at 10:57
  • 3
    "When you start RStudio it's common to find variables you didn't create." It is? Never happens to me. But I don't load a previously saved workspace. CRAN packages should not add anything to the global environment. – Roland Oct 19 '16 at 10:58
  • hi @Roland, iris from datasets is accessible from global environment. is there a way to known which package a variable is created in if I don't know that in advance? – mt1022 Oct 19 '16 at 12:22
  • `iris` is on the search path if the datasets package is attached (the default) but *not* in the global environment. – Roland Oct 19 '16 at 12:26
  • 1
    If you want to keep this from happening : Tools > Global Options > General. Then uncheck the following boxes, "restore most recently opened project...", "Restore .RData into workspace ..." Also set the "save workspace to .RData on exit" to either "Ask" or "Never." This will keep you from needlessly saving intermediate objects. – lmo Oct 19 '16 at 12:29
  • @Roland, thanks. I found `where` from `pypr` is helpful for unstanding this. http://stackoverflow.com/questions/16583211/how-to-get-environment-of-a-variable-in-r – mt1022 Oct 19 '16 at 12:32

0 Answers0