[R] Use of [:alnum:] or . in gsub() etc..

ppaarrkk simon_ecc at yahoo.co.uk
Fri Jan 16 17:13:58 CET 2009



test = c ( "AAABBB", "CCC" )


This works :

gsub ( "[A-Z]", "2", test )



None of these do :

gsub ( "[A-Z]", [:alnum:], test )
gsub ( "[A-Z]", [[:alnum:]], test )
gsub ( "[A-Z]", "[:alnum:]", test )
gsub ( "[A-Z]", "[[:alnum:]]", test )
gsub ( "[A-Z]", "^[:alnum:]$", test )



What am I doing wrong, please ?

-- 
View this message in context: http://www.nabble.com/Use-of--%3Aalnum%3A--or-.-in-gsub%28%29-etc..-tp21502786p21502786.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list