2

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

Luca Braglia
  • 3,133
  • 1
  • 16
  • 21
  • isnt that just a note? if you're on a unix, you wouldnt have that function or device. I don't think you can shut them up, though. I get the same things for referencing in-house packages – rawr May 07 '14 at 00:56
  • @rawr, no it's a warning. Thanks – Luca Braglia May 07 '14 at 07:45
  • … and it should be a warning. Unfortunately, as long as you miss the Rd file that you are referencing, you will get a warning. You might be able to spoof the checker by copying the file manually. – Fr. Aug 13 '15 at 18:38

0 Answers0