This question is very similar to this question but when I try the answer I receive an addition 'NOTE' following R CMD check
. Although it is just a NOTE
I would really like to have a completely clean check.
* checking Rd line widths ... NOTE
Error: 8: no comma in argument list following \S4method
Execution halted
I can get rid of this if I pass all the other parameters (i,j,drop
) and document all of them but I don't use them. It seems to me that it would be a waste to just add in extra documentation when it isn't relevant in this case.
#' An S4 class that stores a list.
#' @export
setClass("testClass",
representation(a="list"))
#' Extract parts of testClass.
#' @param x testClass
#'
setMethod("[", signature(x = "testClass"),
function (x){
print("void function")
}
)
The Rd file resulting in the error:
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/test.R
\docType{methods}
\name{[,testClass-method}
\alias{[,testClass-method}
\title{Extract all elements}
\usage{
\S4method{[}{testClass}(x)
}
\arguments{
\item{x}{testClass}
}
\description{
Extract all elements
}
The following Rd results in no error if I define and document all the arguments
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/test.R
\docType{methods}
\name{[,testClass,missing,missing,missing-method}
\alias{[,testClass,missing,missing,missing-method}
\title{Extract all elements}
\usage{
\S4method{[}{testClass,missing,missing,missing}(x, i, j, drop)
}
\arguments{
\item{x}{testClass}
\item{i}{missing}
\item{j}{missing}
\item{drop}{missing}
}
\description{
Extract all elements
}
i
,j
, etc.) unless otherwise explicitly documented. The more surprising part to me was that R CMD check was only complaining about the malformed docs, as opposed to the improper method definition. – Ulyssesumayyad