3
我已經安裝了下面的類在我的定製[R包警告:爲什麼devtools給我@slot需要的名稱和說明
#' 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's 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 ...
}
當我運行devtools::document
自動生成我.Rd文件,爲什麼我會收到以下警告?
Warning:
@slot [stock.returns.R#16]: requires name and description
Warning:
@param [stock.returns.R#28]: requires name and description
你的'@slot timeframe'沒有描述,也沒有'@param timeframe',並且警告告訴你這些參數'需要一個名稱和描述' – SymbolixAU
@SymbolixAU就是這樣!謝謝,我現在感覺有點傻了 – lebelinoz
我已經有很多次這個警告:) – SymbolixAU