[R-pkg-devel] Using RC_fopen in a CRAN package

Dirk Eddelbuettel edd @end|ng |rom deb|@n@org
Fri Apr 2 16:27:03 CEST 2021


On 2 April 2021 at 09:45, Duncan Murdoch wrote:
| On 01/04/2021 9:06 p.m., David Cortes wrote:
| > Is it allowed to use such functions in packages? I see a few packages
| > currently in CRAN have the same note in the checks, such as "iotools",
| > and am wondering if I should just email the CRAN maintainer explaining
| > that I intend to use the function anyway, since it's just a note rather
| > than a warning or error.
| 
| The CRAN policy document is quite clear on this: "CRAN packages should 
| use only the public API. Hence they should not use entry points not 
| declared as API in installed headers nor .Internal() nor .Call() etc 
| calls to base packages. Also, ::: should not be used to access 
| undocumented/internal objects in base packages (nor should other means 
| of access be employed). Such usages can cause packages to break at any 
| time, even in patched versions of R. "
| 
| So you are free to use that function, but CRAN won't publish your 
| package if you do.

What you can do is to republish the functions in a package you own and
maintain, and then export them from there. I have done that in RApiDatetime
for some date/time parsing code, and in RApiSerialize for serialization.

It is not ideal as your copies may become stale over time. But it gives you a
way forward as long as R Core exercises their right to have non-public APIs.
As R Core has demonstrated exemplary fidelity to the parts of the API that
are public, we should not be too grumpy that they reserve this option.

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org



More information about the R-package-devel mailing list