[R-pkg-devel] [External] May .External2() be used in packages?

iuke-tier@ey m@iii@g oii uiow@@edu iuke-tier@ey m@iii@g oii uiow@@edu
Wed May 1 21:32:17 CEST 2024


yOn Wed, 1 May 2024, Konrad Rudolph wrote:

> Thanks,
> 
> That’s a shame but good to know.
>
>       Packages that for whatever reason have chosen to use it
>       could instead use .External(), and that is what yo should use.
> 
> 
> Unfortunately .External() is not a replacement (in general, or for my
> purpose) since it’s missing the `call` and `rho` arguments, and computing
> the same information without these arguments in C code is far from trivial.

The call you would get is not likely to be all that useful, but it is
the one you wrote. The environment is the one you get from environment()
at the point where you would call .External2. So instead of

.External2("foo", x, y)

do

.External("foo", quote(.External2("foo", x, y)), environment(), x, y)

and adjust your C function accordingly.

Best,

luke

> --
> Konrad Rudolph // @klmr
> 
>

-- 
Luke Tierney
Ralph E. Wareham Professor of Mathematical Sciences
University of Iowa                  Phone:             319-335-3386
Department of Statistics and        Fax:               319-335-3017
    Actuarial Science
241 Schaeffer Hall                  email:   luke-tierney using uiowa.edu
Iowa City, IA 52242                 WWW:  http://www.stat.uiowa.edu


More information about the R-package-devel mailing list