Is it possible to @inheritParams from a function within another package?

余生长醉 提交于 2019-12-10 13:28:15

问题


I wrote an importer for an obscure TSV format, which I want to package and document: https://github.com/katrinleinweber/MWX-import/commits/package

The importer function passes a renamed skip_lines parameter to utils::read.table so I would like to "pass" the latter's documentation of skip into my .Rd. However, trying a few notations like @inheritParams utils::read.table skip always results in Warning: Failed to find topic […].

Whether it's actually possible to inherit a single, specific parameter from another package's function is not clear to me after reading http://r-pkgs.had.co.nz/man.html and https://blog.rstudio.org/2017/02/01/roxygen2-6-0-0/.

Is it possible? If yes, thanks for any hint!


回答1:


If you use @inheritParams utils::read.table, then any parameters in your function which match those in utils::read.table will be inherited (provided they aren't already explicitly documented). So this would cover your use case if you used skip instead of skip_lines.

I don't think it's possible to inherit documentation for a parameter when your parameter name doesn't match though.



来源:https://stackoverflow.com/questions/42703052/is-it-possible-to-inheritparams-from-a-function-within-another-package

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!