brian avants
2013-Apr-10 17:53 UTC
[Rd] question re: error message --- package error: "functionName" not resolved from current namespace
hello everyone we are developing a package that has worked up until R3.0 which we just tested. the issue is as above .... when we call a function that works in R 2.15.2 from R 3.0 we get an error Error in .Call("antsImageRead", filename, pixeltype, dimension) : "antsImageRead" not resolved from current namespace (ANTsR) this Error occurs when the .Call is made from within the .R function wrapper that eases access to the C++ version of antsImageRead. however, a direct .Call("antsImageRead", etc. ) works as usual. this happens for some of our functions and not others - not all are .Calls ... i don't see a pattern to it. a hack resolution that "works" is to source the .R files again within the R shell. of course, this is not a satisfying solution. finally, if anyone cares to try to reproduce this error, here is what you would do: If you have CMake installed, then open R 3.0 and do: install.packages(c("devtools", "Rcpp", "methods", "signal", "parallel", "timeSeries", "mFilter", "MASS", "robust", "magic", "knitr", "pixmap", "rgl", "misc3d")) then Clone or Pull ANTsR from this repository as follows: $ git clone git@github.com:stnava/ANTsR.git>From the parent directory of the new ANTsR directory, install the packageas follows: $ R CMD INSTALL ANTsR finally - the error can be reproduced in R 3.0 as : library(ANTsR) fi<-antsImageRead( getANTsRData('r16') ,2) any help would be appreciated - brian [[alternative HTML version deleted]]
Simon Urbanek
2013-Apr-10 18:15 UTC
[Rd] question re: error message --- package error: "functionName" not resolved from current namespace
On Apr 10, 2013, at 1:53 PM, brian avants wrote:> hello everyone > > we are developing a package that has worked up until R3.0 which we just > tested. > > the issue is as above .... when we call a function that works in R 2.15.2 > from R 3.0 we get an error > > Error in .Call("antsImageRead", filename, pixeltype, dimension) : > "antsImageRead" not resolved from current namespace (ANTsR) >I won't answer your question directly but some suggestions: a) does adding PACKAGE="ANTsR" to .Call change anything? (It should really be there if you are using strings as names) b) you may want to consider use the more efficient registration - either explicit or in NAMESPACE - so in your case you could use NAMESPACE: useDynLib(ANTsR, antsImageRead, ...) foo.R: .Call(antsImageRead, ...) Cheers, Simon> this Error occurs when the .Call is made from within the .R function > wrapper that eases access to the C++ version of antsImageRead. > > however, a direct .Call("antsImageRead", etc. ) works as usual. > > this happens for some of our functions and not others - not all are .Calls > ... > > i don't see a pattern to it. > > a hack resolution that "works" is to source the .R files again within the R > shell. > > of course, this is not a satisfying solution. > > finally, if anyone cares to try to reproduce this error, here is what you > would do: > > > If you have CMake installed, then open R 3.0 and do: > > > install.packages(c("devtools", "Rcpp", "methods", "signal", "parallel", > "timeSeries", "mFilter", "MASS", "robust", "magic", "knitr", > "pixmap", "rgl", "misc3d")) > > then Clone or Pull ANTsR from this repository as follows: > > $ git clone git at github.com:stnava/ANTsR.git > >> From the parent directory of the new ANTsR directory, install the package > as follows: > > $ R CMD INSTALL ANTsR > > > finally - the error can be reproduced in R 3.0 as : > > library(ANTsR) > fi<-antsImageRead( getANTsRData('r16') ,2) > > any help would be appreciated - > > brian > > [[alternative HTML version deleted]] > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > >