I have the following database:
id x
1 2
1 3
2 3
3 3
3 3
3 3
I wanted to create a new database without repeating the value of the field id
, to solve this I can average the values of field x
that belongs to the same id
.
My question is: How can I do this in R
?