Sounds like an Rcpp question and should be asked on the Rcpp mailing list

  http://lists.r-forge.r-project.org/mailman/listinfo/rcpp-devel

Sorry for the run-around!

Martin

On 09/05/2018 02:17 PM, André Luiz Molan wrote:
Hi,

I'm trying to create an R package using Rcpp. I am using the "Build" option
from RStudio and roxygen2 package. My package is build with no error
messages and normally loaded. However, when I call a function from the new
package, I have the following message:

*Error in .Call(<pointer: (nil)>, val1) :
   NULL value passed as symbol address
Called from: MakeSquare(x = val)*


This is just a simple function I have created for testing:


cppFunction('double MakeSquare(double x){
         double result = 0;
         result = x*x;
         return result;

}')


The Rcpp function I have created above is called by another function:

CalcSquare <- function(val1,val2){
     valResult <- (val1 + val2)/2
     valSquare <- MakeSquare(x = valResult)
     return(valSquare)
}


I have imported all the necessary packages, including Rcpp. I have looked
at different discussion forums by I did not find any solution.

I sincerely hope you could help me.

Best regards,

André

        [[alternative HTML version deleted]]

_______________________________________________
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel


_______________________________________________
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel

Reply via email to