[Bioc-devel] Building of a package using Rcpp in R version 5.1

André Luiz Molan @ndre@mol@n @ending from une@p@br
Wed Sep 5 20:17:28 CEST 2018


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)

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,


	[[alternative HTML version deleted]]

More information about the Bioc-devel mailing list