Roxygen2 文档依赖函数
Roxygen2 document dependency of a function
我不知道应该如何记录一个函数需要第二个函数或一个包。是否有特定的标签这样做,或者我应该在功能描述中这么说?
#' @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}
#' }
我不知道应该如何记录一个函数需要第二个函数或一个包。是否有特定的标签这样做,或者我应该在功能描述中这么说?
#' @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}
#' }