R/raster.R, and 4 more
convert objects into a stars object
st_as_stars(.x, ...) # S3 method for list st_as_stars(.x, ..., dimensions = NULL) # S3 method for default st_as_stars(.x = NULL, ..., raster = NULL) # S3 method for stars st_as_stars(.x, ..., curvilinear = NULL, crs = st_crs(4326)) # S3 method for bbox st_as_stars( .x, ..., nx, ny, dx = dy, dy = dx, xlim = .x[c("xmin", "xmax")], ylim = .x[c("ymin", "ymax")], values = 0, n = 64800, pretty = FALSE, inside = FALSE ) # S3 method for sf st_as_stars(.x, ..., name = attr(.x, "sf_column")) # S3 method for Raster st_as_stars(.x, ...) # S3 method for ncdfgeom st_as_stars(.x, ..., sf_geometry = NA) # S3 method for stars_proxy st_as_stars( .x, ..., downsample = 0, url = attr(.x, "url"), envir = parent.frame() ) # S3 method for xts st_as_stars(.x, ..., dimensions) # S3 method for OpenStreetMap st_as_stars(.x, ..., as_col = FALSE)
object to convert
object of class dimensions
character; the names of the dimensions that denote raster dimensions
only for creating curvilinear grids: named length 2 list holding longitude and latitude matrices; the names of this list should correspond to raster dimensions to be replaced
object of class
integer; number of cells in x direction; see details
integer; number of cells in y direction; see details
numeric; cell size in x direction; see details
numeric; cell size in y direction; see details
length 2 numeric vector with extent (min, max) in x direction
length 2 numeric vector with extent (min, max) in y direction
value(s) to populate the raster values with
the (approximate) target number of grid cells
logical; should cell coordinates have pretty values?
logical; should all cells entirely fall inside the bbox, potentially not covering it completely?
character; name for the geometry dimensions
sf data.frame with geometry and attributes to be added to stars object. Must have same number of rows as timeseries instances.
integer: if larger than 0, downsample with this rate (number of pixels to skip in every row/column); if length 2, specifies downsampling rate in x and y.
character; URL of the stars endpoint where the data reside
environment to resolve objects in
logical; return rgb numbers (FALSE) or (character) color values (TRUE)?
curvilinear is a
stars object with longitude and latitude values, its coordinate reference system is typically not that of the latitude and longitude values.
bbox method: if
TRUE, raster cells may extend the coordinate range of
.x on all sides. If in addition to
dy are also missing, these are set to a single value computed as
ny are missing, they are computed as the ceiling of the ratio of the (x or y) range divided by (dx or dy), unless
TRUE, in which ceiling is replaced by floor. Postive
dy will be made negative. Further named arguments (
...) are passed on to
ncdfgeom method: objects are point-timeseries with optional line or polygon geometry for each timeseries specified with the
sf_geometry parameter. See ncdfgeom for more about this NetCDF-based format for geometry and timeseries.
xts methods, if
dimensions are provided, time has to be the first dimension.