Using roxygen2 to inherit only certain parameters
Asked Answered
D

1

27

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.)

Drice answered 24/6, 2017 at 19:11 Comment(2)
I think this question is related to this one and also to this one.Putout
Does this answer your question? How to use @inheritParams on single parameters when multiple parameters match?Hospitalet
D
24

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.

Dianndianna answered 9/9, 2017 at 10:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.