I followed the following example to extract data from Netcdf Link. It went all good but the problem I faced is to extract the data by spatial polygon (shapefiles). How do I extract the data (o3) using polygon shapefiles instead of lat/lon box?
Instead of defining the region lonIdx <- which(lon >= -40 & lon <= 10) latIdx <- which(lat >= 30 & lat <= 45) I want to use spatial polygon.