How to enable Rd warning "Missing file link" when creating packages in RStudio?

After creating a simple test suite to isolate this problem, I get the following warning at startup Rcmd.exe INSTALL --nomultiarch --with-keep.source simpleTest:

* installing to library 'C:/Users/user/Documents/R-dev'
* installing *source* package 'simpleTest' ...
** R
** preparing package for lazy loading
** help
*** installing help indices
  converting help for package 'simpleTest'
    finding HTML links ...    hello                                   html  
Rd warning: C:/user/RPackages/simpleTest/man/hello.Rd:11: missing file link 'transmute'
 done
** building package indices
** testing if installed package can be loaded
* DONE (simpleTest)

The problem occurs when you reference functions that point to an Rd file of a different name. For example, in my simpleTest package, the documentation refers to both dplyr::mutate()and to dplyr::transmute(), both of which are documented in the mutate.Rd file. The first link does not raise an Rd warning, while the last does. However, both links work when you view the help page for the current package.

The .R file for the simpleTest package is shown below. I run devtools::document()and then create the package in the skeleton package directory.


hello.R

#' print hello
#'
#' This does something less complicated than \code{\link[dplyr:mutate]{dplyr::mutate()}} 
#' and \code{\link[dplyr:transmute]{dplyr::transmute()}}.

#' @export
hello <- function() {
  print("Hello, world!")
}
+4
1

, , . \link{foo}, foo - (, , ). :

\link[pkg]{foo}
\link[pkg:foo]{bar}

foo , , . ?dplyr::mutate, , mutate - ( ) transmute - . , , () , , .

, :

\link[dplyr:mutate]{dplyr::transmute()}

: https://cran.r-project.org/doc/manuals/R-exts.html#Cross_002dreferences

+2

Source: https://habr.com/ru/post/1692665/


All Articles