Does this do what you want.
> x <- "a,b,c|1,2,3|4,5,6|7,8,8"
> x.1 <- strsplit(x, "[|]")
> x.1
[[1]]
[1] "a,b,c" "1,2,3" "4,5,6" "7,8,8"
> x.2 <- lapply(x.1, strsplit, ',')
> x.2
[[1]]
[[1]][[1]]
[1] "a" "b" "c"
[[1]][[2]]
[1] "1" "2" "3"
[[1]][[3]]
[1] "4" "5" "6"
[[1]][[4]]
[1] "7" "8" "8"
> do
On Dec 17, 2009, at 8:11 AM, venkata kirankumar wrote:
Hi all,
Hi this is kiran
I am facing a problem to split a dataframe
that is..
i have a string like:"a,b,c|1,2,3|4,5,6|7,8,8"
first I have to split with respect to "|"
I did it with command
unlist(strsplit("a,b,c|1,2,3|4,5,6|7,8,8"
Hi all,
Hi this is kiran
I am facing a problem to split a dataframe
that is..
i have a string like:"a,b,c|1,2,3|4,5,6|7,8,8"
first I have to split with respect to "|"
I did it with command
unlist(strsplit("a,b,c|1,2,3|4,5,6|7,8,8", "\\,"))
after getting that set i made it as a datafram
3 matches
Mail list logo