Get MERRA-2 grid
type of grid-data to return, spatial points ("points") or polygons ("poly")
(optional) integer vector of location identifiers for which the grid will be returned.
numeric vector (min and max) with the range of longitude coordinates of the grid to return. Default `c(-180, 180)`.
numeric vector with the range of latitude coordinates of the grid to return. Default `c(-180, 180)`.
target coordinate reference system: object of class 'sf::crs', or input string for `sf::st_crs`. Default `4326`.
logical, should merra-points coordinates (`lon`, `lat`) be added to the data. FALSE by default.
logical, in the case of "polygons" grid, should points at poles be added to the data. TRUE by default.
Returns `sf` object with MERRA-2 grid, points or polygons. If polygons requested, grid of will be returned where MERRA2 coordinates are considered as centers of every polygon, except cells with `lat = -90` or `lat = 90`. Spatial points will be returned for the cells near poles.
x <- get_merra2_grid()
#> Error in st_as_sf(x): could not find function "st_as_sf"
head(x)
#> Error in eval(expr, envir, enclos): object 'x' not found
getGrid("poly", "sf")
#> Error in getGrid("poly", "sf"): could not find function "getGrid"
getGrid(lon = c(-70, -60), lat = c(30, 40), class = "df")
#> Error in getGrid(lon = c(-70, -60), lat = c(30, 40), class = "df"): could not find function "getGrid"