Despite a lot of documentation and questions that I have already read in this forum, I still haven't been able to properly document my S3 generics. My code works, and I have successfully used my package, and even successfully tested it with friends. I am using Roxygen2 in linux, here is my session info:
> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.3 LTS
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=en_US.UTF-8 LC_ADDRESS=en_US.UTF-8
[10] LC_TELEPHONE=en_US.UTF-8 LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] DiversityOccupancy_1.0.0
Here I send one of the most simple generics I have:
#' @param x a modeldiversity object which is a result from the modeldiversity
#' function
#' @examples
#' \dontrun{
#' data("BatOccu")
#' data("Dailycov")
#' data("sampling.cov")
#' x <-diversityoccu(pres = BatOccu, sitecov = sampling.cov, obscov = Dailycov,
#' spp = 17, form = ~ Julian + Meanhum + Meantemp + sdhum + sdtemp ~
#' Burn.intensity.soil + I(Burn.intensity.soil^2) + Burn.intensity.Canopy +
#' I(Burn.intensity.Canopy^2) + Burn.intensity.basal +
#' I(Burn.intensity.basal^2))
#' y <- model.diversity(x, method = "g", squared = TRUE)
#' summary(y)
#' }
#' @export
summary <- function(x, ...){
UseMethod("summary")
}
#' @rdname summary
#' @export
#' @method summary modeldiversity
#' @seealso \code{\link[DiversityOccupancy]{diversityoccu}}
#' @author Derek Corcoran <derek.corcoran.barrios@gmail.com>
summary.modeldiversity <- function (x, ...) {
x$Table
}
the warnings I get are the following:
Undocumented arguments in documentation object 'summary' ‘...’ Duplicated \argument entries in documentation object 'summary': ‘x’
But so far everywhere I have read tells me that is a good thing to put the ... after your function.
The second problem with the duplicated x
goes away if I remove the
summary <- function(x, ...){
UseMethod("summary")
}
But then I get warnings for not properly documenting s3 methods, anyone knows the solution for this?
Thanks