Re: [R] convert 'list' to 'vector'?

2011-08-11 Thread Liviu Andronic
On Wed, Aug 10, 2011 at 11:39 PM, David Winsemius wrote: >> is.vector(x) > [1] TRUE > > You probably didn't realize that lists _are_ vectors before this. > Nice to know. > Hopefully this expected invitation to grilling will not result in severe > burns. I note that one of the *apply family would

Re: [R] convert 'list' to 'vector'?

2011-08-10 Thread peter dalgaard
On Aug 10, 2011, at 23:39 , David Winsemius wrote: > Hopefully this expected invitation to grilling will not result in severe > burns. I note that one of the *apply family would have been successful in > returning the desired object in conjunction with c() : > > > rapply(x, c) > [1] "a" "b" "c

Re: [R] convert 'list' to 'vector'?

2011-08-10 Thread David Winsemius
On Aug 10, 2011, at 3:58 PM, Liviu Andronic wrote: On Wed, Aug 10, 2011 at 9:32 PM, David Winsemius > wrote: Thanks all! This is perfect, and very R-ish: never where a novice would expect it to be. Well, since `unlist` is linked in the See Also on the help page for `list`, I can only hope

Re: [R] convert 'list' to 'vector'?

2011-08-10 Thread Liviu Andronic
On Wed, Aug 10, 2011 at 9:32 PM, David Winsemius wrote: >> Thanks all! This is perfect, and very R-ish: never where a novice >> would expect it to be. > > Well, since `unlist` is linked in the See Also on the help page for `list`, > I can only hope you meant that in complete jest. > More or less.

Re: [R] convert 'list' to 'vector'?

2011-08-10 Thread David Winsemius
On Aug 10, 2011, at 3:10 PM, Liviu Andronic wrote: On Wed, Aug 10, 2011 at 9:02 PM, R. Michael Weylandt wrote: unlist() Thanks all! This is perfect, and very R-ish: never where a novice would expect it to be. Well, since `unlist` is linked in the See Also on the help page for `list`, I

Re: [R] convert 'list' to 'vector'?

2011-08-10 Thread Liviu Andronic
On Wed, Aug 10, 2011 at 9:02 PM, R. Michael Weylandt wrote: > unlist() > Thanks all! This is perfect, and very R-ish: never where a novice would expect it to be. Cheers Liviu __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-

Re: [R] convert 'list' to 'vector'?

2011-08-10 Thread Jean V Adams
unlist(x) r-help-boun...@r-project.org wrote on 08/10/2011 01:58:57 PM: > [image removed] > > [R] convert 'list' to 'vector'? > > Liviu Andronic > > to: > > r-help@r-project.org Help > > 08/10/2011 02:02 PM > > Sent by: >

Re: [R] convert 'list' to 'vector'?

2011-08-10 Thread Dimitris Rizopoulos
Check function unlist(). Best, Dimitris On 8/10/2011 8:58 PM, Liviu Andronic wrote: Dear all How does one convert a "non-symmetric" list to a vector? See below: x<- list() x[[1]]<- letters[1:5] x[[2]]<- letters[6:10] x[[3]]<- letters[11:12] x [[1]] [1] "a" "b" "c" "d" "e" [[2]] [1] "f" "g

Re: [R] convert 'list' to 'vector'?

2011-08-10 Thread R. Michael Weylandt
unlist() Michael Weylandt On Wed, Aug 10, 2011 at 2:58 PM, Liviu Andronic wrote: > Dear all > How does one convert a "non-symmetric" list to a vector? See below: > > > x <- list() > > x[[1]] <- letters[1:5] > > x[[2]] <- letters[6:10] > > x[[3]] <- letters[11:12] > > x > [[1]] > [1] "a" "b" "c"

[R] convert 'list' to 'vector'?

2011-08-10 Thread Liviu Andronic
Dear all How does one convert a "non-symmetric" list to a vector? See below: > x <- list() > x[[1]] <- letters[1:5] > x[[2]] <- letters[6:10] > x[[3]] <- letters[11:12] > x [[1]] [1] "a" "b" "c" "d" "e" [[2]] [1] "f" "g" "h" "i" "j" [[3]] [1] "k" "l" > paste(x) [1] "c(\"a\", \"b\", \"c\", \"d\"