I have a sample survey sheet; something like demographic. One of the columns is country (factor)
another is annual income
. Now, I need to calculate average of each country and store in new data.frame
with country
and corresponding mean. It should be simple but I am lost. The data is something like the one shown below:
Country Income($) Education ... ... ...
1. USA 90000 Phd
2. UK 94000 Undergrad
3. USA 94000 Highschool
4. UK 87000 Phd
5. Russia 77000 Undergrad
6. Norway 60000 Masters
7. Korea 90000 Phd
8. USA 110000 Masters
.
.
I need a final result like:
USA UK Russia ...
98000 90000 75000
Thank You.