From simon.urbanek at r-project.org  Wed Apr 10 20:15:32 2013
From: simon.urbanek at r-project.org (Simon Urbanek)
Date: Wed, 10 Apr 2013 14:15:32 -0400
Subject: [Rd] question re: error message --- package error:
	"functionName" not resolved from current namespace
In-Reply-To: <CABWzF4XhbD_LGy0UeVSiLd-cHbbvH9z+QTMrRQD1_PMvZv-=6w@mail.gmail.com>
References: <CABWzF4XhbD_LGy0UeVSiLd-cHbbvH9z+QTMrRQD1_PMvZv-=6w@mail.gmail.com>
Message-ID: <CC350C70-2837-4160-B8EF-F391188D4667@r-project.org>


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
> 
> 



[Rd] question re: error message --- package error: "functionName" not resolved from current namespace
Simon Urbanek