2

Is there a way to remove from the autocomplete all objects associated to libraries that are not in the global environment, aside from their functions?

For example the plyr package loads baseball. I want to remove all these dataframe loaded by packages because I don't want them in memory and also because the autocomplete function looks through all these objects that I never use.

Is there code or an option to remove these objects systematically or force libraries only to load their functions and the strictly necessary objects?

Herman Toothrot
  • 1,463
  • 3
  • 23
  • 53
  • # CLear R environment and all the loaded files rm(list = ls()) gc – Hunaidkhan Sep 28 '18 at 13:04
  • This might be useful: https://stackoverflow.com/questions/19838360/how-to-import-only-one-function-from-another-package-without-loading-the-entire – abcalphabet Sep 28 '18 at 13:04
  • Also this might be relevant: https://stackoverflow.com/questions/27709936/get-a-list-of-the-data-sets-in-a-particular-package – RLave Sep 28 '18 at 13:05
  • For what it's worth: Datasets that come with packages are *not* automatically loaded into memory upon loading the library. Only `data(baseball)` loads `baseball` into the current R environment (which you can check with `ls()`). – Maurits Evers Sep 28 '18 at 13:10
  • @Hunaidkhan sorry but no, that removes MY objects and doesn't remove the rest. – Herman Toothrot Sep 28 '18 at 13:18
  • @MauritsEvers you are correct, the objects are not in the environment, but I need to exclude them from the RStudio auto complete. This might be an RStudio issue. – Herman Toothrot Sep 28 '18 at 13:19

0 Answers0