【问题标题】:Is it possible to @inheritParams from a function within another package?是否可以从另一个包中的函数@inheritParams?
【发布时间】:2017-07-30 21:26:13
【问题描述】:

我为一种晦涩的 TSV 格式编写了一个导入器,我想对其进行打包和记录:https://github.com/katrinleinweber/MWX-import/commits/package

导入器函数将重命名的skip_lines 参数传递给utils::read.table,所以我想将后者的skip 文档“传递”到我的.Rd 中。但是,尝试使用@inheritParams utils::read.table skip 之类的符号总是会得到Warning: Failed to find topic […]

在阅读http://r-pkgs.had.co.nz/man.htmlhttps://blog.rstudio.org/2017/02/01/roxygen2-6-0-0/ 之后,我不清楚是否真的可以从另一个包的函数中继承单个特定的参数。

有可能吗?如果是,感谢您的任何提示!

【问题讨论】:

    标签: r documentation roxygen2


    【解决方案1】:

    如果您使用@inheritParams utils::read.table,则函数中与utils::read.table 中的参数匹配的任何参数都将被继承(前提是它们尚未明确记录)。因此,如果您使用 skip 而不是 skip_lines,这将涵盖您的用例。

    我认为当您的参数名称不匹配时,无法继承参数的文档。

    【讨论】:

      猜你喜欢
      • 2010-10-10
      • 2020-07-29
      • 1970-01-01
      • 2023-02-08
      • 2011-11-04
      • 1970-01-01
      • 1970-01-01
      • 2019-12-01
      • 1970-01-01
      相关资源
      最近更新 更多