[R-pkg-devel] Inquiry

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Wed Sep 28 11:19:06 CEST 2022


On 27/09/2022 9:37 p.m., Rolf Turner wrote:
> 
> On Tue, 27 Sep 2022 07:43:03 +0000
> Georgi Boshnakov <georgi.boshnakov using manchester.ac.uk> wrote:
> 
>>> ...functions, that are not meant to be called directly by users,
>>> should be documented in a file named <pkgnm>-internal.Rd.
>>
>> This is one option, convenient in the use-case of the question. But
>> why export a function that you actively don't want the users to know
>> about?
> 
> <SNIP>
> 
> Why would you not want users to know about functions?  This strikes me
> as being overly authoritarian. Of course, to export or not to export
> is the choice of the package author.  It is also sensible to try to
> protect users from shooting themselves in the foot.  However if they
> really want to shoot themselves in the foot, that's their call. >
> Anyway, users can always get at non-exported functions using ":::".


There are (at least) two kinds of users.  The more common kind writes 
scripts that use your package.  I think your argument is valid for that 
group, though many of them are never going to read your warning about 
functions being intended for internal use.

However, some users are package writers.  Once their package is on CRAN, 
it can be really inconvenient for you to change the behaviour of 
internal functions that they use, because CRAN will object if your 
change breaks their tests.  That makes it harder to write those internal 
functions, because you have to get them "right" the first time, or 
support the bad behaviour if someone relied on it.

Duncan Murdoch



More information about the R-package-devel mailing list