Re: [R] decomposing a single intact vector

2012-06-28 Thread Rui Barradas
Hello, Try x <- "(O, O, O, H, L, O, O, O, O)" strsplit(gsub("\\(|\\)|[[:blank:]]", "", x), ",") Note that the result is a list, not a vector. You can then use `[[` or unlist(). Hope this helps, Rui Barradas Em 28-06-2012 11:42, Jessy escreveu: Dear all, I have a vector of length 1 but

Re: [R] decomposing a single intact vector

2012-06-28 Thread Sarah Goslee
You can use gsub() to eliminate the parentheses, and strsplit() to separate the elements. Sarah On Thursday, June 28, 2012, Jessy wrote: > Dear all, > > I have a vector of length 1 but within this vector there are 9 elements > > vectorNOcorrection > [1] "(O, O, O, H, L, O, O, O, O)" > can someon

[R] decomposing a single intact vector

2012-06-28 Thread Jessy
Dear all, I have a vector of length 1 but within this vector there are 9 elements > vectorNOcorrection [1] "(O, O, O, H, L, O, O, O, O)" can someone help me with how I can have it as with 9 element separated such that it will have length 9 as "O", "O"," O", "H","L", "O", "O", "O", "O" Kind rega