knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  message=FALSE,
  warning = FALSE
)
library(cwdata)
library(dplyr)
library(ggplot2)
c

Potatoes is the crop whiich is produced maximum in the year 2017

key_crop_yields %>%  
  group_by(year,crop) %>% 
  summarise(tonnes_per_hectare = sum(tonnes_per_hectare,na.rm = TRUE)) %>% 
  ggplot(aes(x = year,
             y = tonnes_per_hectare,
             color = crop)) +
  geom_line()+
  labs(
    x = "Crops",
    y = "Tonnes Per Hectare",
    title = "Global Crop production"
  )


kgar0017/cwdata documentation built on Dec. 21, 2021, 6:37 a.m.