library(RCurl)
#Download very large crop choice files created using the Hyrdobase map file in QGIS. This has every crop and technology combination for all parcels in 2002, or 2005. This is used as the pre-treatment control for crop choice correlated with factors such as soil quality.
#These files are excluded from git due to the very large space requirment. Instead Alex Gebben has hosted them on a Pcloud drive, and provided public access, allowing git to ignore them but have R download at project start.

#Location of the files
CROP_2002_URL <- 'https://def3.pcloud.com/DLZHyJ74J7ZfHere67ZCPjOZXZqxJG5kZ2ZZM3FZZTvmJZzYZsLZ3TZH807r8lSpP0MjbM4PoY9z7sxqCDy/IRRIG_2002.csv'
CROP_2005_URL <- 'https://def3.pcloud.com/DLZwyJ74J7Z7zere67ZCPjOZXZExJG5kZ2ZZM3FZZuVFHZ3YZnYZmgZ9u59W63pgNRX6L94jxED10e4TrYk/IRRIG_2005.csv'

DEST_DIR <- "./Data/Crop_Choice/"
dir.create(DEST_DIR,showWarnings=FALSE)
download.file(CROP_2002_URL,destfile=paste0(DEST_DIR,"IRRIG_2002.csv"))
download.file(CROP_2005_URL,destfile=paste0(DEST_DIR,"IRRIG_2005.csv"))
