check
Roxygenで割り当て関数を使用するのに問題があります。
これはかなり最小限の例です:
#' Get sp feature IDs
#' @aliases IDs IDs.default IDs.SpatialPolygonsDataFrame IDs<- IDs<-.SpatialPolygonsDataFrame
#' @param x The object to get the IDs from or assign to
#' @param value The character vector to assign to the IDs
#' @param \dots Pass-alongs
#' @author Ari B. Friedman
#' @rdname IDs
IDs <- function(x,...) {
UseMethod("IDs",x)
}
#' @method IDs default
#' @S3method IDs default
#' @rdname IDs
IDs.default <- function(x,...) {
stop("Currently only SpatialPolygonsDataFrames are supported.")
}
#' @method IDs SpatialPolygonsDataFrame
#' @S3method IDs SpatialPolygonsDataFrame
#' @rdname IDs
IDs.SpatialPolygonsDataFrame <- function(x,...) {
vapply(slot(x, "polygons"), function(x) slot(x, "ID"), "")
}
#' Assign sp feature IDs
#' @rdname IDs
"IDs<-" <- function( x, value ) {
UseMethod("IDs<-",x)
}
#' @method IDs<- SpatialPolygonsDataFrame
#' @S3method IDs<- SpatialPolygonsDataFrame
#' @rdname IDs
"IDs<-.SpatialPolygonsDataFrame" <- function( x, value) {
spChFIDs(x,value)
}
そして私が走るときcheck
:
* checking for code/documentation mismatches ... WARNING
Codoc mismatches from documentation object 'IDs':
IDs<-
Code: function(x, value)
Docs: function(x, value, value)
IDs<-.SpatialPolygonsDataFrame
Code: function(x, value)
Docs: function(x, value, value)
value
2番目がどこから来ているのかわかりません。@param value
おそらくRoxygenが割り当て関数のエントリを自動的に作成するという理論を排除しようとしましたが、それは定義を排除せず、(x,value,value)
定義していないことを訴える新しい警告を生成しvalue
ます。
.Rd
生成された関連部分は次のとおりです。
\usage{
IDs(x, ...)
\method{IDs}{default} (x, ...)
\method{IDs}{SpatialPolygonsDataFrame} (x, ...)
IDs(x, value) <- value
\method{IDs}{SpatialPolygonsDataFrame} (x, value) <-
value
}
そこにあると主張する(x, value, value)
署名が見当たりません。check
これはS3関数ですが、S4オブジェクトで動作しています。それでもS3になるはずだと思います。しかし、そうでない場合は、私の使用が@S3method
問題である可能性があります。
ヘルプ?