> Jeroen Ooms
> on Tue, 10 May 2016 16:39:08 +0200 writes:
> The following used to work in R 3.2.5 but not in 3.3.0:
> library(MASS)
> ns <-.getNamespace("MASS")
> unloadNamespace(ns)
or simply
ns <- getNamespace("MASS") ;
The following used to work in R 3.2.5 but not in 3.3.0:
library(MASS)
ns <-.getNamespace("MASS")
unloadNamespace(ns)
Calling unloadNamespace("MASS") directly still works.
__
R-devel@r-project.org mailing list
Paul,
In the version of R I had trivially available, the flushSession function
from switchr seems to perform as expected when tseries is loaded.
library(tseries)
library(tseries)
‘tseries’ version: 0.10-32
‘tseries’ is a package for time series analysis and computational
finance.
It's probably because the first thing that unloadNamespace does is this:
ns - asNamespace(ns, base.OK = FALSE)
If you call asNamespace(tseries), it calls getNamespace(tseries), which
has the side effect of loading that package (and its dependencies).
One way to work around this is to check
Thanks Winston. That seems like a workaround that might be usefully
included into unloadNamespace.
Paul
On 15-01-09 12:09 PM, Winston Chang wrote:
It's probably because the first thing that unloadNamespace does is this:
ns - asNamespace(ns, base.OK = FALSE)
If you call
In the documentation the closed thing I see to an explanation of this is
that ?detach says Unloading some namespaces has undesirable side effects
Can anyone explain why unloading tseries will load zoo? I don't think
this behavior is specific to tseries, it's just an example. I realize
one
Paul,
My switchr package (https://github.com/gmbecker/switchr) has the
flushSession function which does what you want and seems to work (on my
test machine at least).
I havent tested it under a recent Rdevel, or with that specific package,
however I will soon, as the overarching model of switchr
Dear all,
Consider this code:
library(data.table)
unloadNamespace('data.table')
It produces some warnings
Warning in FUN(X[[1L]], ...) :
Created a package name, 2013-10-29 17:05:51, when none found
Warning in FUN(X[[1L]], ...) :
Created a package name, 2013-10-29 17:05:51, when none
This was previously reported and fixed. See the NEWS file and bug
report 15481.
On 10/29/13 9:19 AM, Karl Forner wrote:
Dear all,
Consider this code:
library(data.table)
unloadNamespace('data.table')
It produces some warnings
Warning in FUN(X[[1L]], ...) :
Created a package name,
G'day all,
On Fri, 20 Feb 2009 04:01:07 + (GMT)
Prof Brian Ripley rip...@stats.ox.ac.uk wrote:
library.dynam.unload() does work if the OS is cooperative. And if
you have your package set up correctly and unload the namespace (and
not just detach the package if there is a namespace) then
This was rather a large shift of subject, so I've pruned the
recipients list.
Is lazy loading involved? If so I have an idea that may or may not be
relevant. We do cache in memory the lazy-loading database for speed
on slow (network-mounted or USB drive) file systems. Now the cache is
G'day Brian,
On Fri, 20 Feb 2009 11:37:18 + (GMT)
Prof Brian Ripley rip...@stats.ox.ac.uk wrote:
This was rather a large shift of subject, [...]
Well, yes, from the clean unloading of compiled code to the clean
unloading of R code. :-)
Though, I also confirmed that the former is
In my package's zzz.R, I put
.Last.lib - function(libpath) {
unloadNamespace(mypackage)
}
and I exported .Last.lib in NAMESPACE, with the intent that detaching
the package would also cause the name space to be unloaded. However, the
result of detach(package:mypackage) is then
Error:
13 matches
Mail list logo