In a data frame as input:
data.frame(group = c(1,1,1,2,2,3), number = c(10,10,10,5,5,1))
How is it possible to check which is the group number using the group column and calculate for every number the average score of the number column?
Example of expected output:
group avg_number
1 10
2 5
3 1