igues
To: Rui Barradas
Cc: r-help@r-project.org
Sent: Wednesday, January 16, 2013 11:23 PM
Subject: Re: [R] Mean calculation by two variables
Hello Rui!
Thanks a lot for your help!
Sorry for make mistake with the factor's name, was inattention during data
preparation for the asking
Hello Rui!
Thanks a lot for your help!
Sorry for make mistake with the factor's name, was inattention during data
preparation for the asking mail.
Unfortunately, it not simple mean calculation, because same individual
could have more than one row, if it eat more than a food item. In example
data
Hello,
If you want to calculate the mean weight by Specie and Food.item, you
can use ?aggregate.
In what follows, I've named your EXAMPLE ex and your SOLUTION sol. Note
that the result is different from sol.
(No exemplo não há Peixe, é Fish, e os números são outros.)
aggregate(Weight ~ Specie +
Hello All,
I have a data frame (dput information below) with food item weight for fish
species.
I need to calculate the Mean proportion by weight of each food item for
each specie, as show in solution data frame (dput information below).
I use the ddply function (plyr package) in two steps. Firs
4 matches
Mail list logo