5

I am using a package: KML (k-means for longitudinal data).

When the package is loaded it loads 6 more packages.

Loading required package: kml
Loading required package: clv
Loading required package: cluster
Loading required package: class
Loading required package: longitudinalData
Loading required package: rgl
Loading required package: misc3d

I am trying to DETACH the packages once I am done using it. However, I keep on getting errors/warning on attempt.

When detaching using, detach("package:kml", unload=TRUE) or/and unloading them using unloadNamespace("kml") this step works without any error as if it has been detached.

When I check the (.packages()). kml is no more listed there but other packages are still loaded. But when I check loadedNamespaces() kml is still loaded there. Now proceeding further with next package.

detach("package:longitudinalData", unload=TRUE)

Gives me a warning message:

Warning message: ‘longitudinalData’ namespace cannot be unloaded:
namespace ‘longitudinalData’ is imported by ‘kml’ so cannot be unloaded

Rest of the package are either dependent on "kml" or "longitudinalData" so I get the same message for all of the packages. And all the packages including kml and longitudinalData are still listed under loadednamespaces.

Any idea how can I unload them?

ro ko
  • 2,906
  • 3
  • 37
  • 58
  • try adding more arguments `character.only = TRUE, force=TRUE`? from http://stackoverflow.com/questions/7505547/detach-all-packages-while-working-in-r/7505716#7505716 – chinsoon12 Apr 27 '17 at 08:53
  • 2
    "Once the package is loaded it uses up whole lot of CPU and my computer heats up." Umm, a package that is loaded should not use a "lot of CPU". I have my doubts that your diagnosis is correct. – Roland Apr 27 '17 at 09:01
  • @chinsoon12 already tried it, doesn't work with that option either. – ro ko Apr 27 '17 at 09:16
  • @Roland perhaps I might have exaggerated it a bit too much saying 'lot of cpu'. (I unfortunately don't know how to check proper cpu usage onwindows except for task manager. On taskmanager, the cpu usage increased from 0% to 5% solely after loading the package and wouldn't go down. More importantly I usually work while travelling and once the package is loaded my remaining battery drops from 7 hours to 2 hours right away, and I can feel my laptop heating up. Anyway more important matter here is how to unload the package regardless of its CPU usage. – ro ko Apr 27 '17 at 09:34

0 Answers0