我在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}
,它给出了相同的结果(老实说,我并没有完全理解它的含义)。
提示&#34;闭嘴&#34;检查?谢谢,卢卡