Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using roxygen2 to inherit only certain parameters

Tags:

In roxygen2, one can use the tag @inheritParams to inherit the full set of parameters of another function. But is it also possible to inherit only a certain subset of them? (Excluding the case of inheriting ..., which is adequately handled by @inheritDotParams.)

like image 352
egnha Avatar asked Jun 24 '17 19:06

egnha


1 Answers

In the header of functionA:

@inheritParams functionB, at least in Roxygen 6.0.0., will only inherit the parameters from functionA that also are found in functionB. Any parameters that are shared but that are defined in the functionA header will not be inherited from functionB.

So, the selection is built-in.

like image 101
Ken Benoit Avatar answered Sep 23 '22 12:09

Ken Benoit