[R] recognizing "(" as a character

Jean Eid jeaneid at chass.utoronto.ca
Sat Nov 15 15:26:09 CET 2003

Dear All,
I have been trying to scan data from pdf files and use R to seperate them.
The following will make it clear
I have a line that reads
"Intrepid (D)  15,977 11,956 45,143 39,014"
where what is in the parenthesis is either a "D" for domestic or "I" for
I want to try to strsplit the line according to the full character "(D)"
or "(I)"  but unfortunately R recognizes this as "D", or "I" in the
strsplit command. my question is is there any way that I can tell R that
this "(" is a character.
P.S. even grep() does have the same problem. I know this is not a problem
since "(", ")", "[", etc.. are predefined in R but why is the quotation
marks for strings not doing its job here?

Jean Eid

More information about the R-help mailing list