I am writing a package but one persistent R CMD check
warning prevents me from finishing the package and posting it to CRAN. I use roxygen2
for inline documentation, although that possibly isn't the root cause of the error.
If you know what to do to remove this warning, I can quite possibly figure out a way of doing it using roxygen2
.
How can I remove the warning Functions/methods with usage in documentation object ... but not in code
from my package checks?
The R CMD check
warning:
* checking for code/documentation mismatches ... WARNING
Functions/methods with usage in documentation object 'names<-' but not in code:
names<-
The function and roxygen
documentation:
#' Updates names and variable.labels attribute of surveydata.
#'
#' @name names<-
#' @rdname names
#' @aliases names<- names<-.surveydata
#' @param x surveydata object
#' @param value New names
#' @method names<- surveydata
#' @usage names(x) <- value
"names<-.surveydata" <- function(x, value){
invisible(NULL)
}
The resulting .rd
documentation file:
\name{names<-}
\alias{names<-}
\alias{names<-.surveydata}
\title{Updates names and variable.labels attribute of surveydata.}
\usage{
names(x) <- value
}
\arguments{
\item{x}{surveydata object}
\item{value}{New names}
}
\description{
Updates names and variable.labels attribute of
surveydata.
}
I have cross-checked my documentation with the documentation for names<-
in base R, and it seems identical:
\title{ The Names of an Object}
\name{names}
\alias{names}
\alias{names.default}
\alias{names<-}
\alias{names<-.default}
\keyword{attribute}
\description{Functions to get or set the names of an object.}
Related question (but I have already implemented the suggestion and still no luck):
- How to properly document a S3 method of a generic from a different package, using Roxygen?
Where am I going wrong? How can I remove this warning from the package checks?