#parse and save the area data, creating two classifications
#grab the areas from the NHD 1:100k processed data
nhd = read.table('data-raw/area/nhd_area.csv', sep=',', header=TRUE, quote='\"', as.is=TRUE)
names(nhd) = c('site_id', 'area_m2')
lter = read.csv('data-raw/area/lter_lake_areas.csv', as.is=TRUE)
lter$site_id = lter$id
lter$area_m2 = lter$area_ha * 1e4
#merge to area
area = rbind(nhd, lter[,c('site_id', 'area_m2')])
#Add area data to sysdata if it doesn't already contain it
if(file.exists('R/sysdata.rda')){
sysdata = new.env()
load('R/sysdata.rda', envir=sysdata, verbose=TRUE)
rm(sysdata, envir=sysdata)#weird hack, I don't understand save
}else{
sysdata = new.env()
}
sysdata$area = area
save(list=names(sysdata), file = "R/sysdata.rda", envr=sysdata, compress=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.