This function converts a netcdf object to a raster object
Arguments
- nc
The nc file path
- varname
The name of the variable to convert to a raster
- extent
The latitude and longitude range the data should have, of the form c(xmin, xmax, ymin, ymax). Defaults to
c(0, 360, -90, 90)
- crop
An extent object to use to crop data. Defaults to
raster::extent(280, 300, 30, 50)
(Northeast US)- show_images
Boolean. Whether to display images of the data. Useful to check if cropping is occurring correctly.