Colleagues

R 2.10.1 on a Mac

I read in textfiles using readLines, then I process those files, then I use R 
to execute another program.  Occasionally those files contain characters other 
than letter / numbers /  routine punctuation marks.  For example, a bullet 
(option-8 on a Mac) triggers the problem.

Although R can read and process those characters, the other program cannot so I 
would like to identify these characters and exit gracefully with a warning.

I discovered that the following works:
        any(is.na(strsplit(readLines(FILE), "")))

I am wondering whether anyone has a better approach to this problem.

Dennis

Dennis Fisher MD
P < (The "P Less Than" Company)
Phone: 1-866-PLessThan (1-866-753-7784)
Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to