I am trying to calculate the percent of production by source in 2018 for each continent
Here is my code :
df_tidy %>%
group_by (Country, tonnes) %>%
select (Country, tonnes, year) %>%
filter (Country %in% c("Africa,Americas,Asia,Europe,Oceania","tonnes")) %>%
summarise (total.global.production = tonnes/sum(df_tidy$tonnes, na.rm=T)*100)
summarise()
regrouping output by 'Country', 'tonnes' (override with .groups
argument)". I am unsure how to fix my code since its run but I am not receiving a correct output.