I'm working in a UNIX environment and making a package where an utility function's Rd
needs to link to grDevices::win.metafile
help page (that is Windows-specific). My .R
file (using roxygen2
) is
#' Open a vectorial device file in a portable way.
#'
#'
#' Portable function which choose what (vectorial) device to open looking at
#' the system.
#'
#'
#' @usage graph(file, width, height, ...)
#' @param file path without extension
#' @param width width in inches
#' @param height height in inches
#' @param ... other arguments passed to \code{\link{pdf}} or
#' \code{\link[grDevices]{win.metafile}}
#' @return Values returned by pdf or win.metafile?
#' @keywords pdf win.metafile vectorial graph
#' @export graph
graph <- function(file="", width = 7,
height = 7, ...) {
if (Sys.info()["sysname"]=="Linux") {
path <- paste(file, "pdf" ,sep=".")
pdf(file=path, width = width, height = height, ...)
} else if (Sys.info()["sysname"]=="Windows") {
path <- paste(file, "emf" ,sep=".")
win.metafile(filename=path, width = width, height = height, ...)
}
}
However, when going to R CMD check
, a WARNING is issued:
Missing link or links in documentation object 'graph.Rd':
‘[grDevices]{win.metafile}’
See the information in section 'Cross-references' of the 'Writing R
Extensions' manual.
I've looked at Cross-references of Writing R Extensions but the only alternative method seems to be [grDevices:win.metafile]{win.metafile}
, that gives the same results (and honestly speaking i didn't understand fully its meaning).
Any hint to "shut up" the checks? Thanks, Luca