I have a data frame called "Bycountry" like this:
Countries Norders 1 Algerie 1 2 France 2 3 Tunisie 3 4 Algerie 4 5 Allemagne 5 6 France 6
I want to do statistics on this dataframe:
- in country column, a summary of the countries (no duplicate)
- in numbers column, the sum by countries
I already installed plyr
and dplyr
packages so I know that I have to use mutate()
, summarise()
, group_by()
but I don't know in which or and how.
Otherbycountry <- data.frame(
Countries = c("Algerie", "France", "Tunisie", "Algerie",
"Allemagne", "France"),
Norders = c(1 , 2 , 3, 4, 5, 6))
The current result is a 1x1 tibble with the total sum of the numbers.