# Load libraries
library(tidyverse)
# Set working directory (e.g. via Session menu button, or via setwd() function)
# Load data
crop <- read_csv("data/raw/legumes/Crop.csv")
site <- read_csv("data/raw/legumes/Site.csv")
fertilization <- read_csv("data/raw/legumes/Fertilization.csv")
irrigation <- read_csv("data/raw/legumes/Irrigation.csv")
# Filter crop to only the 6 species:
crop <- crop %>%
filter(Crop_Species_Common_Name %in% c("Chickpea","Fababean",
"Garden pea","Lentil",
"Peanut","Soybean"))
crop
## # A tibble: 3,415 × 14
## IDCrop IDRotation Crop_Species_Scientific_Name Crop_Species_Common_Name Crop_Species_Legume Crop_Date_Seeding Crop_Date_Harvest Crop_Date_From_Seeding…¹ Crop_Yield_Grain
## <dbl> <dbl> <chr> <chr> <dbl> <chr> <chr> <dbl> <dbl>
## 1 853 263 Cicer arietinum Chickpea 1 NA Dec. 2000 NA NA 2001 NA 2.89
## 2 854 264 Vicia faba Fababean 1 NA Dec. 2000 NA NA 2001 NA 3.71
## 3 857 265 Lens culinaris Lentil 1 NA Dec. 2000 NA NA 2001 NA 1.37
## 4 858 266 Pisum sativum Garden pea 1 NA Dec. 2000 NA NA 2001 NA 4.2
## 5 859 4749 Cicer arietinum Chickpea 1 NA Dec. 2001 NA NA 2002 NA 1.42
## 6 860 4750 Vicia faba Fababean 1 NA Dec. 2001 NA NA 2002 NA 1.65
## 7 861 4751 Lens culinaris Lentil 1 NA Dec. 2001 NA NA 2002 NA 0.66
## 8 862 4752 Pisum sativum Garden pea 1 NA Dec. 2001 NA NA 2002 NA 3.18
## 9 864 4757 Cicer arietinum Chickpea 1 NA Dec. 2004 NA NA 2005 NA 2.69
## 10 865 4758 Vicia faba Fababean 1 NA Dec. 2004 NA NA 2005 NA 3.17
## # ℹ 3,405 more rows
## # ℹ abbreviated name: ¹Crop_Date_From_Seeding_To_Harvest_Day_Number
## # ℹ 5 more variables: Crop_Yield_Grain_Unit <chr>, Crop_Biomass_Aerial <dbl>, Crop_Biomass_Aerial_Unit <chr>, Crop_Harvest_Index <lgl>, IDSite <dbl>