[R-pkg-devel] Advice on elegant way to alias function name

J C Nash pro|jcn@@h @end|ng |rom gm@||@com
Sat Sep 3 15:22:55 CEST 2022


Hadley is correct. I had a typo in one of the tags.

And the @usage tag is not needed.

Thanks to all.

JN


On 2022-09-02 17:46, Hadley Wickham wrote:
> On Fri, Sep 2, 2022 at 3:22 PM J C Nash <profjcnash using gmail.com> wrote:
>>
>> With some playing around I found a workable solution.
>>
>> - NAMESPACE needs  export(thefn)
>> - thefn.Rd needs usage and arguments documented
>> - myfn.Rd must NOT have alias(thefn)
>>
>> And I believe I've got the roxygen2 tags to work in Rstudio. In R itself,
>> roxygen2 gives an error
>>       Error: invalid version specification ‘0.68’
>> though the string '0.68' appears nowhere in my package according to grep.
>> I have no idea what this is about, especially as Rstudio works fine.
>>
>> While I like the idea of documentation in code files, I think I'll go
>> back to separately created .Rd files.
>>
>> If anyone is interested, package and README are at
>> https://gitlab.com/nashjc/nlsr2022
> 
> All you need is:
> 
> #' @export
> #' @rdname wrapnlsr
> nlsr <- wrapnlsr
> 
> That will document nlsr and nlsr together in the same file.
> 
> In general, if you find yourself having to use `@usage` or `@aliases`
> to get R CMD check to pass cleanly, something is off with the way
> you're documenting your functions.
> 
> Hadley
>



More information about the R-package-devel mailing list