So the solution is : tapply(content, list(factor1, factor2), mean)
An example of what it does :
> my.data
name item vote
1 Ricardo Coke 20
2 Ricardo Fanta 60
3 Ricardo Pepsi 100
4 Marie Pepsi 40
5 Marie Coke 60
6 Julia
Hello,
First, thanks for your help (and sorry for my english !)
I have a data frame in which each row represents a vote (in percent, only
20,40, 60,80,100) of one person on one content, with three columns : name
(the name of the voters), content_id, vote :
str(votesredac)
'data.frame': 1000 o
Seems that the following makes what I want :
attach(votesredac)
tapply(value, list(name, content_id), mean)
Only thing is, I don't need to make a mean - there is only one or no value.
VinceD wrote:
>
> Hello,
>
> First, thanks for your help (and sorry for my english !)
&
3 matches
Mail list logo