简体   繁体   中英

R render Rd using roxygen2 without roxygen2 version

Auto-documentation feature using roxygen2, while it is great and useful, it is annoying on every change of roxygen2 package version. It updates all my documentation files by putting roxygen2 version inside each file. See below.

% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/src.R

Such changes obviously don't affect the code/package but did affect source control versioning by adding a noise to your source versioning process.
Could it be turned off somewhere?

This probably borders on cheating, but if you redefine packageVersion() priot to compiling your package, like so:

packageVersion  <- function(pkg,...)()
    if(pkg == "roxygen2") "Hello World" else utils::packageVersion('pkg',...)

You'll get:

% Generated by roxygen2 (Hello World): do not edit by hand

instead of

% Generated by roxygen2 (4.1.1): do not edit by hand

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM