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

Plamen Mirazchiyski p|@men@m|r@zch|y@k| @end|ng |rom |ner|@org
Thu Oct 26 15:43:54 CEST 2023


Thank you very much for your responses Duncan and Ivan.

I do not call .Internal(crossprod( ... )) directly. I use crossprod() 
just once in the entire package, the actual line of code is

unname(obj = crossprod(x = sweep(x = as.matrix(replicated.averages), 
MARGIN = 2, mean.replicate.averages, FUN = "-"))*des.scale.fac)

I followed Ivan's advice, built a binary package from source in R 4.3.1 
on Windows 10, then tested it on another Windows 10 machine with R 
4.3.1. The problem did not occur et all.

If I understand Ivan's email, my package should work on R 4.3.1, but 
what about newer versions? I checked some packages that were released 
today, e.g. abn, these were built by CRAN "using R Under development 
(unstable) (2023-10-24 r85407 ucrt)". Does this mean mine will fail on 
the current released version (4.3.1) if built by CRAN. As far as I see 
from the R Developer Page (https://developer.r-project.org), there is a 
new version (4.3.2) scheduled for October 31, 2023. Should I better wait 
until then?

Best,
Plamen

On 10/25/23 21:26, Ivan Krylov wrote:
> В Wed, 25 Oct 2023 21:02:00 +0200
> Plamen Mirazchiyski <plamen.mirazchiyski using ineri.org> пишет:
> 
>> Today I was preparing a new version for the RALSA package. I have
>> built a Windows package using "devtools::check_win_devel()".
> 
>> 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"
> 
> Can you use R CMD build to make a .tar.gz source package and then
> install that on the Windows 10 machine running R 4.3.1? There is
> convenience and a lot of added value in both Win-Builder and devtools,
> but it shouldn't be necessary to rely on 96 CRAN packages and an online
> service just to build a package.
> 
> crossprod(x,y) has indeed been recently changed from
> .Internal(crossprod(x, y)) to .Primitive("crossprod"). This makes it
> possible for a binary package prepared using R-devel (with a call to
> .Primitive('crossprod')) to misbehave on a released version of R (which
> does have .Internal(crossprod(...)) but not .Primitive('crossprod')).
> 
> Installing from source will avoid this problem. So will building the
> binary package using R-4.3.1 to run it on a different machine with
> R-4.3.1.
> 
> 
> 

-- 
======================
Plamen Mirazchiyski, PhD
International Educational Research and Evaluation Institute
24 Tehnološki park
SI-1000 Ljubljana
Slovenia
tel.: +386 51 303 817
email: plamen.mirazchiyski using ineri.org




More information about the R-package-devel mailing list