Re: [R] repeated searching of no-missing values

2008-12-11 Thread Patrizio Frederic
dear Hadley and Bert, thank you very much for your suggestions. I asked one question and I learned 2 things: 1. Hadley, library(plyr) ddply(data, .(V1), colwise(cl)) that is exactly what I was searching for. 2. Bert, ?tapply says that the first argument is an **atomic** vector. A factor is

Re: [R] repeated searching of no-missing values

2008-12-11 Thread Stavros Macrakis
On Wed, Dec 10, 2008 at 6:39 PM, Bert Gunter gunter.ber...@gene.com wrote: ...?tapply says that the first argument is an **atomic** vector. A factor is not an atomic vector. So tapply interprets it as such by looking only at its representation, which is as integer values. What is the

[R] repeated searching of no-missing values

2008-12-10 Thread Patrizio Frederic
hi all, I have a data frame such as: 1 blue 0.3 1 NA0.4 1 red NA 2 blue NA 2 green NA 2 blue NA 3 red 0.5 3 blue NA 3 NA1.1 I wish to find the last non-missing value in every 3ple: ie I want a 3 by 3 data.frame such as: 1 red 0.4 2 blue NA 3 blue 1.1 I have written a little

Re: [R] repeated searching of no-missing values

2008-12-10 Thread Bert Gunter
To: r-help@r-project.org Subject: [R] repeated searching of no-missing values hi all, I have a data frame such as: 1 blue 0.3 1 NA0.4 1 red NA 2 blue NA 2 green NA 2 blue NA 3 red 0.5 3 blue NA 3 NA1.1 I wish to find the last non-missing value in every 3ple: ie I want a 3 by 3

Re: [R] repeated searching of no-missing values

2008-12-10 Thread hadley wickham
On Wed, Dec 10, 2008 at 4:09 PM, Patrizio Frederic [EMAIL PROTECTED] wrote: hi all, I have a data frame such as: 1 blue 0.3 1 NA0.4 1 red NA 2 blue NA 2 green NA 2 blue NA 3 red 0.5 3 blue NA 3 NA1.1 I wish to find the last non-missing value in every 3ple: ie I want a

Re: [R] repeated searching of no-missing values

2008-12-10 Thread hadley wickham
graphics,statistical analysis etc. as well as programming. There are just too many possible data structures to expect logical consistency in their handling throughout (if one can even define what that means in specific instances!). I disagree with this claim: I think it is possible to create

Re: [R] repeated searching of no-missing values

2008-12-10 Thread Bert Gunter
] On Behalf Of hadley wickham Sent: Wednesday, December 10, 2008 3:52 PM To: Bert Gunter Cc: r-help@r-project.org Subject: Re: [R] repeated searching of no-missing values graphics,statistical analysis etc. as well as programming. There are just too many possible data structures to expect logical

Re: [R] repeated searching of no-missing values

2008-12-10 Thread hadley wickham
Perhaps... But plyr works only on **basic** data structures, and I referred to all **possible** data strucures (deliberately); so I stand by my statement and note that you did not contradict it. To me the basic structures are vectors, matrices and arrays; lists; and data frames (that these are