Closed topepo closed 7 years ago
That is very strange, I export dimRedMethodList
just as any other function and it isn't even a method.
From your error message I would think that this is unrelated, but try running:
names(completeClassDefinition("dimRedMethod", doExtends = FALSE)@subclasses)
from inside your package. You might need to import the classes dimRedMethod
and all children (or maybe just the methods you are using) separately.
Have you tried calling dimRed::embed(...)
?
I added a print statement for that line and get output before the error:
[1] "DiffusionMaps" "DRR" "FastICA" "KamadaKawai"
[5] "DrL" "FruchtermanReingold" "HLLE" "Isomap"
[9] "kPCA" "LaplacianEigenmaps" "LLE" "MDS"
[13] "nMDS" "PCA" "tSNE"
Error in eval(expr, envir, enclos) :
could not find function "dimRedMethodList"
Calling as dimRed::embed
had the same results.
It is weird... before loading dimRed
I can access it via dimRed::dimRedMethodList
and dimRed:::dimRedMethodList
. Even more, I imported the whole dimRed
package and still get the same error.
I'll figure out how to convert over to non-embed
code. Can .mute
be passed into the @fun
and @apply
functions?
that is strange, I will try this myself when I find some time.
You can look at the implementation of the embed
function and simply copy the code I use for muting: https://github.com/gdkrmr/dimRed/blob/master/R/embed.R#L115
You are trying to use Isomap? I had some problems with the CVST
package I use for the DRR
method and had to import the whole thing because of namespace issues.
Another weird namespace hack I had to do is here, maybe it helps : https://github.com/gdkrmr/dimRed/blob/master/R/kpca.R#L116
I can reproduce it without a package:
dimRed::embed(dimRed::dimRedData(iris[1:4]),
"Isomap", knn = 25,
ndim = 2, .mute = "")
in a fresh R session gives the same error.
It works for me. Thanks
I'm creating a package that imports
dimRed
and I'm getting an error ("Error in eval(expr, envir, enclos) : could not find function "dimRedMethodList") when invoking this code:I know that this isn't reproducible but it otherwise works when using
Isomap
directly instead ofembed(,"Isomap")
. I've tried importingdimRedMethodList
too but had the same error. Loading the package prior to invoking this function also works.