Why is devtools warning me that @slot requires a name and description

I configured the following class in my customized R package:

#' A stock.returns class is an xts of stock(s) returns, a timeframe and the currency used.
#'
#' @slot xts_returns An xts of stock returns (potentially multiple stocks)
#' @slot timeframe
#' @slot currency Any three letter currency, or "Local"
#' @include timeframe.R
#' @export
stock.returns <- setClass(
    Class = "stock.returns",
    slots = c(xts_returns = "xts", timeframe = "timeframe", currency = "character"),
    prototype = prototype(xts_returns = xts::xts(, order.by = c(lubridate::today())), timeframe = timeframe(), currency = "Local")
)

#' A stock.returns class is an xts of stock(s) returns, a timeframe and the currency used.
#'
#' @param timeframe
#' @param benchmark_code The code for the index of stocks you want the returns for.
#' @param portfolio_code The code for the portfolio of stocks you want the returns for.
#' @param sec_id_list An explicit list of sec_id you want the returns for.
#' @param currency Any three letter currency, or "Local".  The default is "AUD".
#' @export
stock.returns <- function(
    timeframe, benchmark_code, portfolio_code, sec_id_list, currency = "AUD") { 
        # ... code goes here ...
}

      

When I run devtools::document

to automatically generate my .Rd files , why am I getting the following warnings?

Warning:
 @slot [stock.returns.R#16]: requires name and description
Warning:
 @param [stock.returns.R#28]: requires name and description

      

+3


source to share


1 answer


Parameters for a documented function require both a name and a description.

In your code @slot timeframe

, @param timeframe

there is only a name component, it also needs a description (like all your other parameters)



This does not affect / stop the package from being created or installed, but to get the package on CRAN you need to complete all the required parameters and descriptions.

+3


source







All Articles