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)>, x) :
  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é
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to