On May 8, 2010, at 10:05 AM, Webby wrote:


Dear community,

I have a problem with a string conversion:

text
[1] ""                   "and"                "\xc1d\xe1m"
[4] "graphical"          "interface"          "MLP"
[7] "Nagy"               "networks"           "Networks"
[10] "neural"             "Neural"             "RBF"
[13] "<sod...@yahoo.com>" "user"               "with"
[16] "and"                "\xc1d\xe1m"         "graphical"
[19] "interface"          "MLP"


I need to get rid off text[3,17] !

Does this work>

text[ grep("[[:alnum:]]|", text) ]


Still gives the warnings but seems to properly leave out the "control- sequences".

I have this kind of control-sequence a few times in my text and I do not get
rid of it, by strsplit or sub.

grep("\xc1d\xe1m",text)
Error in grep("\xc1d\xe1m", text) :
 regular expression is invalid in this locale
grep("\\xc1d\\xe1m",text)
integer(0)
Warning messages:
1: In grep("\\xc1d\\xe1m", text) :
 input string 3 is invalid in this locale
2: In grep("\\xc1d\\xe1m", text) :
 input string 17 is invalid in this locale

Thanks in advance,
Georg

______________________________________________
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.

David Winsemius, MD
West Hartford, CT

______________________________________________
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