[R] how to find non-ASCII characters in .Rd files?

Michael Friendly friendly at yorku.ca
Fri Jul 30 03:27:00 CEST 2010


[Env: Win XP Pro / R 2.11.1]

I keep occasionally running into the annoying problem of getting 
warnings from R CMD check regarding
non ASCII characters in .Rd files, without any easy way of finding them.

Mostly these come from copy/paste of references or other material from 
web pages or Win applications,
and often involve varieties of quote-like characters, e.g., if I try to 
include output from anova()
as a documentation comment,

#Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

These are extremely hard to spot in an editor and
R CMD check doesn't give line numbers or indicate what non-ASCII 
characters were found,
so the only way I can easily find the offending characters is to copy 
the .Rd file to a linux machine
and run
od -c file.Rd |more

What commands can I run in R against a .Rd file to locate such non-ASCII 
characters


-- 
Michael Friendly     Email: friendly at yorku.ca 
Professor, Psychology Dept.
York University      Voice: 416 736-5115 x66249 Fax: 416 736-5814
4700 Keele Street    http://www.math.yorku.ca/SCS/friendly.html
Toronto, ONT  M3J 1P3 CANADA



More information about the R-help mailing list