Hi Use ave instead of tapply. It is designed for such task
Regards Petr r-help-boun...@r-project.org napsal dne 12.11.2010 10:49:17: > albechan <alberto.case...@satt.biz> > Odeslal: r-help-boun...@r-project.org > > 12.11.2010 10:49 > > Re: [R] filling a vector with a tapply function applied to another vector > > > The first column has 331 rows, the number of factors in the second column is > 20 repeated in order to have 331 rows too. What I need is to reapeat in the > third column each of the 20 results derived from > tapply(firstcolumn,secondcolumn,mean) as many times as each factor appears > in the second column. So I'll have 331 values in the third column as well. > I hope it's clear enough what I need to do. > > -- > View this message in context: http://r.789695.n4.nabble.com/filling-a-vector- > with-a-tapply-function-applied-to-another-vector-tp3039271p3039337.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.