Thursday 30 July 2015

R: strsplit() : split string into substring

“strsplit()” is used to split string into substrings.

Usage
strsplit(string, split)

> x<-"Hello,How,are,you"
> strsplit(x, ",")
[[1]]
[1] "Hello" "How"   "are"   "you"  

> x<- "1988-06-06"
> strsplit(x, "-")
[[1]]
[1] "1988" "06"   "06"  


Prevoius                                                 Next                                                 Home

No comments:

Post a Comment