Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Roxygen2 document dependency of a function

Tags:

r

roxygen2

I wonder how one should document that a function requires a second function or a package. Are there specific tags do to so or should I just say so n the function description?

#' @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
}
like image 919
Yuca Avatar asked Jan 25 '26 04:01

Yuca


1 Answers

I ended up using the idea shown in this post, and wrote the following:

#'@section Dependencies: 
#'  \describe {
#'    \item{package_1}
#'    \item{package_2}
#'    \item{package_n}
#'  }
like image 175
Yuca Avatar answered Jan 27 '26 17:01

Yuca



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!