У меня есть класс R6 myclass
, и я определил для него S3 generic c as.matrix
. Все работает, но я получаю 2 заметки при запуске R CMD check:
Примечание 1:
S3 methods shown with full name in documentation object 'as.matrix.myclass':
'as.matrix.myclass'
The \usage entries for S3 methods should use the \method markup and not
their full name.
See chapter 'Writing R documentation files' in the 'Writing R
Extensions' manual.
Примечание 2:
Found the following apparent S3 methods exported but not registered:
as.matrix.myclass
See section 'Registering S3 methods' in the 'Writing R Extensions'
manual.
Вот как У меня S3 generic c определен и задокументирован (это за пределами класса R6):
#' Converts all cores to R matrices
#'
#' @param x \code{myclass}
#' @param ... other arguments passed to \code{as.matrix()}
#' @return A named list of R matrices.
#' @export
as.matrix.myclass <- function(x, ...) {
sapply(
x$cores,
function(x, ...) as.matrix(x, ...),
USE.NAMES = TRUE, simplify = FALSE
)
}
Я использую более новую версию roxygen, которая поддерживает документацию R6, но я не могу найти какую-либо информация о том, как избавиться от этих заметок. Спасибо!