Skip to content

Underscore character in Rd files

2 messages · Martin Keller-Ressel, Brian Ripley

#
Hi,

I'm trying to document a data frame in Rd format. The data frame contains  
a variable called
'Health_Env'. When I create a template for the Rd file using 'prompt()'  
the variable name is
included as-is and when I run R CMD CHECK I get a latex error because  
latex considers '_' a special character (used for subscripts) which is  
only allowed in math mode.
When I replace the variable name with 'Health\_Env' in the Rd file latex  
runs fine, but I get a codoc-mismatch warning because the backslash is not  
part of the variable name in the data frame.
Is there a way to completely satisfy R CMD CHECK in this case and avoid  
both errors and warnings??

I'm using
_
platform i386-pc-mingw32
arch     i386
os       mingw32
system   i386, mingw32
status
major    2
minor    0.0
year     2004
month    10
day      04
language R


best regards,

Martin Keller-Ressel

--
#
On Thu, 3 Mar 2005, Martin Keller-Ressel wrote:

            
Don't use _ in the \name field (as documented in `Writing R Extensions' 
for your version), or update your R: from the NEWS of R-devel (development 
releases available on CRAN for Windows)

     o	There are no longer any restrictions on characters in the
 	\name{} field of a .Rd file: in particular _ is supported.