2016-07-31 41 views
2

當我嘗試devtools::document()我[R包,我得到的結果是:roxygen2錯誤」錯誤:不知道如何描述數據中的s3方法。「

Updating janitor documentation 
Loading janitor 
Writing NAMESPACE 
Error: Don't know how to describe s3method in data. 

我已經收窄的原因到這些功能標題:

#' @export 
tabyl <- function(...) UseMethod("tabyl") 

#' @inheritParams tabyl 
#' @describeIn Create a frequency table from a vector, returned as a data.frame, showing percentages and with or without including \code{NA} values. A fully-featured alternative to \code{table()}. 
#' @export 
tabyl.default <- function(vec, sort = FALSE, show_na = TRUE, ...) { 
    ... 
} 

#' @inheritParams tabyl.default 
#' @param .data a data.frame. 
#' @param ... arguments passed to tabyl.default. 
#' @describeIn tabyl Create a frequency table from a variable in a data.frame, returned as a data.frame, showing percentages and with or without including \code{NA} values. A fully-featured alternative to \code{table()}. 
#' @export 
tabyl.data.frame <- function(.data, ...){ 
... 
} 

回答

2

泛型函數的名稱必須去在describeIn和您的描述之間。你錯過了它。在上面的例子中,線:

#' @describeIn Create a frequency 

應該是:

#' @describeIn tabyl Create a frequency