[R-pkg-devel] "crossprod" is not a BUILTIN function

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Wed Oct 25 21:19:43 CEST 2023


The sources show that crossprod has become a primitive function. I don't 
think this should affect any R code that calls crossprod(); are you 
trying to call .Internal(crossprod( ... )) directly?

This was in the news a few weeks ago:

"The matrix multiplication functions ‘crossprod()’ and ‘tcrossprod()’ 
are now also primitive and S3 generic, as ‘%*%’ had become in R 4.3.0."

Duncan Murdoch

On 25/10/2023 3:02 p.m., Plamen Mirazchiyski wrote:
> Dear All,
> 
> Today I was preparing a new version for the RALSA package. I have built
> a Windows package using "devtools::check_win_devel()". I took the built
> Windows package and tested it on a Windows 10 machine to see if
> everything works as intended before submitting the source to CRAN. The
> machine has R 4.3.1, the latest official release. After I load the test
> RALSA package, R displays a message saying "Package RALSA built under R
> version 4.4.0", I guess this is what the win-builder uses when the
> source is sent via "devtools::check_win_devel()".
> 
> When testing one of the functions of the newly built RALSA package
> (lsa.corsstabs"), it crashes with the following message:
> 
>       Error in crossprod(x = sweep(x = as.matrix(replicated.averages),
>       MARGIN = 2, : "crossprod" is not a BUILTIN function
> 
> I checked if it is a builtin by:
> 
>       grep(pattern = "cross", x = builtins(), value = TRUE)
> 
> This returned:
> 
>       [1] "tcrossprod" "crossprod"
> 
> I am not sure I understand, the "crossprod" function is in the base
> package and is builtin in 4.3.1, is it dropped in 4.4.0? If yes, how to
> overcome this?
> 
> Please advise.
> 
> Best,
> Plamen
> 
>




More information about the R-package-devel mailing list