-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
project.org] On Behalf Of Sapana Lohani
Sent: Monday, August 27, 2012 1:41 PM
To: R help
Subject: [R] ?nchar ?strsplit
Hi, my data frame is
x<-data.frame(ID=c("abc/def","abc/def/ghi","abc","mno/pqr/st/ab"))
I want to split my column ID using "/" as the place to split. How can I
do that without telling the code how many sub-columns. I could use
nchar(gsub("[^/]","",x$ID)) to get how many "/" are in each row of the
column, but could not use it to split ID in.
Thanks
[[alternative HTML version deleted]]