Simple R question, please help me

6 views
Skip to first unread message

Bear

unread,
May 24, 2010, 12:21:47 PM5/24/10
to MadUseR
For example, let

a <- "2010May10"

How can I take only "Mar" from a?

Probably some kind of command like string(a, 5:7) might be candidate.

M. Ndiaye

unread,
Jun 1, 2010, 8:28:23 AM6/1/10
to mad...@googlegroups.com
Try:
a<-"2010May10"
substr(a,5,7)
gsub(substr(a,5,7),"",a)
?substr
?gsub

Thanks

Ndiaye
Reply all
Reply to author
Forward
0 new messages