When I use R CMD check pkg_name to check my own R package, I obtain warnings like this:
unexpected section header '\examples'
unexpected section header '\keyword'
The problem exists in the .Rd file where I write some example R codes for my own data (i.e. the .Rd file is for a .RDdata file, not for an .R function file). I was thinking that we can just write example codes ("...") between the {}
below:
\example{
...
}
Unfortunately it cannot pass the package checking procedure...Thanks in advance for your help!
I once experienced this problem when using the percentage symbol (%
). I was trying to write documentation for a confidence interval parameter. I then realised that I needed to escape the symbol with a backslash to resolve the error (just like in LaTeX). Thus, I replaced %
with \%
. This fixed the error.
There is a mismatch of { } in the .Rd file that causes the issue. It is very hard to detect,Make sure you have matched pairs before doing R CMD check pkg_name.
This error message may get more hits now that roxygen2 (mercifully) supports markdown. If converting from an old LaTeX-style file, some LaTeX-legal syntax may still by hiding from manual conversion.
Converting from `word' to 'word' resolved my Rd parsing error (i.e., changed the leading backtick to a conventional quote).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With