This function takes a .csv file with gridded lat, long data and aggregates the data by spatial boundaries given different shapefiles.
metis.grid2poly( gridFiles = NULL, regionName = "region", subRegShape = NULL, subRegShpFolder = NULL, subRegShpFile = NULL, subRegCol = NULL, subRegType = "subRegType", aggType = NULL, dirOutputs = paste(getwd(), "/outputs", sep = ""), folderName = NULL, nameAppend = "", labelsSize = 1.2, paramsSelect = "All", scenariosSelect = "All", paramScenariosFixed = NULL, tethysFilesScarcity = NULL, xanthosFilesScarcity = NULL, printGridOverlay = F, saveFiles = T )
gridFiles | Default=NULL. Grid file in .csv format or a R table, data frame or tibble with as a minimum columns with "lat","lon" and "value", |
---|---|
regionName | Default = "region" |
subRegShape | Default=NULL. shapefile over which grid data is to be aggregated. |
subRegShpFolder | Default=NULL. Folder containing boundary region shapefile. Suggested paste(getwd(),"/dataFiles/gis/naturalEarth",sep Default=""), |
subRegShpFile | Default=NULL. Name of sub-region shapefile. Suggested paste("ne_10m_admin_1_states_provinces",sep Default=""), |
subRegCol | Default= NULL. Suggested for states "name", |
subRegType | Default="subRegType". Eg. "states", "basins" etc. |
aggType | Default=NULL. Aggregation method to be used. Either "vol" or "depth" dependening on the type of data provided. |
dirOutputs | Default=paste(getwd(),"/outputs",sep Default=""), |
folderName | Default = NULL |
nameAppend | Default="", |
labelsSize | Default =1.2. Label size for the region names for the gridoverlay plot. |
paramsSelect | Default ="All" |
scenariosSelect | Default ="All" |
paramScenariosFixed | Default=NULL |
tethysFilesScarcity | Default =NULL, |
xanthosFilesScarcity | Default =NULL |
printGridOverlay | Default = F |
saveFiles | Default =T |
A table with data by polygon ID for each shapefile provided