Re: [R] Splitting a set of vectors in a list (Solved )

2008-03-14 Thread John Kane
discussed > within > > > R's > > > > documentation, but > > > > you can find info on it in V&R's "S > Programming", > > > esp. p.24 and 4.3, > > > > "Extracting or replacing coefficients". > > > > &

Re: [R] Splitting a set of vectors in a list (Solved )

2008-03-14 Thread Liaw, Andy
"S Programming", > > esp. p.24 and 4.3, > > > "Extracting or replacing coefficients". > > > > > > No doubt, other S/R books explain it also. > > > > > > Cheers, > > > > > > Bert Gunter > > >

Re: [R] Splitting a set of vectors in a list (Solved )

2008-03-14 Thread John Kane
u can find info on it in V&R's "S Programming", > esp. p.24 and 4.3, > > "Extracting or replacing coefficients". > > > > No doubt, other S/R books explain it also. > > > > Cheers, > > > > Bert Gunter > > Genente

Re: [R] Splitting a set of vectors in a list (Solved )

2008-03-14 Thread Liaw, Andy
xplain it also. > > Cheers, > > Bert Gunter > Genentech Nonclinical Statistics > 47374 > > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of John Kane > Sent: Thursday, March 13, 2008 11:53 AM > To: Henrique

Re: [R] Splitting a set of vectors in a list (Solved )

2008-03-14 Thread Bert Gunter
cal Statistics 47374 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Kane Sent: Thursday, March 13, 2008 11:53 AM To: Henrique Dallazuanna Cc: R R-help Subject: Re: [R] Splitting a set of vectors in a list (Solved ) My thanks to Henrique Dallazuann

Re: [R] Splitting a set of vectors in a list (Solved )

2008-03-13 Thread John Kane
Blood ell ! Thanks very much, it does help give a feel for what's happening. I'll have to do some experimenting. --- Henrique Dallazuanna <[EMAIL PROTECTED]> wrote: > A example: > > x <- rnorm(5) > > x[3] > `[`(x, 3) > `[[`(x, 3) > > x[3:4] > `[`(x, 3:4) > `[[`(x, 3:4) # Error > > > On 13/

Re: [R] Splitting a set of vectors in a list (Solved )

2008-03-13 Thread Henrique Dallazuanna
A example: x <- rnorm(5) x[3] `[`(x, 3) `[[`(x, 3) x[3:4] `[`(x, 3:4) `[[`(x, 3:4) # Error On 13/03/2008, John Kane <[EMAIL PROTECTED]> wrote: > Ah ?Extract. Thanks > > Unless I'm missing something there is nothing in the > Usage or Examples to suggest to a naive reader like me > that one

Re: [R] Splitting a set of vectors in a list (Solved )

2008-03-13 Thread John Kane
Ah ?Extract. Thanks Unless I'm missing something there is nothing in the Usage or Examples to suggest to a naive reader like me that one can use an unbalanced [ or [[, that is withoug a corresponding ] or ]]. I probably am just not understanding the details. --- Henrique Dallazuanna <[EMAIL

Re: [R] Splitting a set of vectors in a list (Solved )

2008-03-13 Thread Benilton Carvalho
or the suggestive :) ?"[" b On Mar 13, 2008, at 2:58 PM, Henrique Dallazuanna wrote: On 13/03/2008, John Kane <[EMAIL PROTECTED]> wrote: Can you point me to some documentation that discusses these usages. I have seen them before but I have never actually figured out how to use them.? See ?

Re: [R] Splitting a set of vectors in a list (Solved )

2008-03-13 Thread Henrique Dallazuanna
On 13/03/2008, John Kane <[EMAIL PROTECTED]> wrote: > My thanks to Henrique Dallazuanna and Phil Spector. > Both solutions worked well. > Phil suggested that an alterative to my function would > be > vect1 = sapply(mylist,'[[',1) > and I see that Henrique used `[` in his solution. > > Can you

Re: [R] Splitting a set of vectors in a list (Solved )

2008-03-13 Thread John Kane
My thanks to Henrique Dallazuanna and Phil Spector. Both solutions worked well. Phil suggested that an alterative to my function would be vect1 = sapply(mylist,'[[',1) and I see that Henrique used `[` in his solution. Can you point me to some documentation that discusses these usages. I have se

Re: [R] Splitting a set of vectors in a list

2008-03-13 Thread Henrique Dallazuanna
If I understand correctly, try this: as.data.frame(lapply(mylist, `[`, 1:max(unlist(lapply(mylist, length) On 13/03/2008, John Kane <[EMAIL PROTECTED]> wrote: > I have a set of character vectors of uneven length > that I have stored in a list. I can easily enough get > any column of them

Re: [R] Splitting a set of vectors in a list

2008-03-13 Thread John Kane
Ideally something like this: == t(cbind( c("cat" , "peach" , NA, NA), bbb <- c("dog" , "apple" ,"iron", NA), ccb <- c("rabbit" ,"orange" ,"zinc" , "silk" ))) == Thanks --- Erik Iverson <[

Re: [R] Splitting a set of vectors in a list

2008-03-13 Thread Erik Iverson
What would you want your output matrix to look like given mylist? John Kane wrote: > I have a set of character vectors of uneven length > that I have stored in a list. I can easily enough get > any column of them using lapply but what I want is to > be able to create a matrix of them. Other tha

[R] Splitting a set of vectors in a list

2008-03-13 Thread John Kane
I have a set of character vectors of uneven length that I have stored in a list. I can easily enough get any column of them using lapply but what I want is to be able to create a matrix of them. Other than some kind of brute force looping approach I have drawn a blank. Would somebody please su