Roxygen2 文档依赖函数

标签 r roxygen2

我想知道应该如何记录一个函数需要第二个函数或一个包。是否有特定的标签这样做,或者我应该在功能描述中这样说?

#' @title Downloads stuff from that place
#' 
#' @details Maybe document the dependency here?
#' 
#' @param stuff Thing to be downloaded
#' @param save_to Where to place the thing
#' @return Nothing. Called for its side effect

download_stuff = function(stuff, save_to) {

    require('RCurl')               # How do document this?

    # thing = download stuff using RCurl
    # write thing to save_to
}

最佳答案

我最终使用了 this post 中所示的想法, 并写下了以下内容:

#'@section Dependencies: 
#'  \describe {
#'    \item{package_1}
#'    \item{package_2}
#'    \item{package_n}
#'  }

关于Roxygen2 文档依赖函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29036235/

相关文章:

r - 预处理或后处理氧气片段

r - 如果 ggplot 在 for 循环内部,则它不起作用,尽管它在 for 循环外部工作

r - 无法将学习模型应用于 R 中的测试数据

r - htmltab 找不到使用数字或字符向量作为 'which' 参数的表

r - 如何从 Dropbox 导入数据集?

R Shiny 改变情节高度

r - R 包的 Roxygen 示例

r - 获取( key )时出错 : lazy-load database

r - 安装自定义包时在 'lib.loc' 中未找到库树

r - 无论如何要使用 Roxygen2 分别记录 S4 类及其构造函数