How to add different data points in a dataframe

Hi everybody,

I have a dataframe with 4 variables: NACE code (char), country (char), year (num) and employment (num). So basically how many people work in a certain industry in a given year and country. Now my problem is that I sometimes have multiple observations for for the same year/industry/country. For example I have 3 observations for inustry F in Austria (AT) in 2008 (like you can see in the picture). Now how would I go about adding these observations into 1 observations?

Big thanks for your help

My approach would be to use tidyverse package,
I would use group_by() and summarise() with the summary being sum()
You can read tutorials for this sort of approach here :
5 Data transformation | R for Data Science (

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.