我在 UNIX 环境中工作并制作一个包,其中一个实用程序函数Rd
需要链接到grDevices::win.metafile
帮助页面(即 Windows 特定的)。我的.R
文件(使用roxygen2
)是
#' 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, ...)
}
}
但是,当转到 时R CMD check
,会发出警告:
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.
我已经查看了编写 R 扩展的交叉引用,但唯一的替代方法似乎是,它给出了相同的结果(老实说,我没有完全理解它的含义)。[grDevices:win.metafile]{win.metafile}
有任何“关闭”支票的提示吗?谢谢,卢卡