Re: [R] Help with one of "those" apply functions

2011-02-02 Thread Robin Jeffries
Thanks Steve, I needed the alternative. tapply worked for my toy example, but it didn't for my real example. it might be b/c it was in a data frame, but i'm not sure. Using plyr did work however. Robin Jeffries MS, DrPH Candidate Department of Biostatistics UCLA 530-624-0428 On Wed, Feb 2, 20

Re: [R] Help with one of "those" apply functions

2011-02-02 Thread Steve Lianoglou
Hi, On Wed, Feb 2, 2011 at 4:08 PM, Robin Jeffries wrote: > Hello there, > > I'm still struggling with the *apply commands. I have 5 people with id's > from 10 to 14. I have varying amounts (nrep) of repeated outcome (value) > measured on them. > > nrep <- 1:5 > id    <- rep(c("p1", "p2", "p3", "

Re: [R] Help with one of "those" apply functions

2011-02-02 Thread Phil Spector
Robin - Does tapply(value,id,sum) do what you want? - Phil Spector Statistical Computing Facility Department of Statistics UC Berk

[R] Help with one of "those" apply functions

2011-02-02 Thread Robin Jeffries
Hello there, I'm still struggling with the *apply commands. I have 5 people with id's from 10 to 14. I have varying amounts (nrep) of repeated outcome (value) measured on them. nrep <- 1:5 id<- rep(c("p1", "p2", "p3", "p4", "p5"), nrep) value <- rnorm(length(id)) I want to create a new vecto