Learn R Programming

stars (version 0.2-0)

st_as_stars: convert objects into a stars object

Description

convert objects into a stars object

Usage

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 = 360, ny = 180, xlim = .x[c("xmin", "xmax")], ylim = .x[c("ymin", "ymax")], values = runif(nx * ny))

# S3 method for sf st_as_stars(.x, ...)

# S3 method for Raster st_as_stars(.x, ...)

# S3 method for stars_proxy st_as_stars(.x, ..., downsample = 0)

Arguments

.x

object to convert

...

ignored

dimensions

object of class dimensions

raster

character; the names of the dimensions that denote raster dimensions

curvilinear

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

crs

object of class crs with the coordinate reference system of the values in curvilinear; see details

nx

integer; number of cells in x direction

ny

integer; number of cells in y direction

xlim

length 2 numeric vector with extent in x direction

ylim

length 2 numeric vector with extent in y direction

values

value(s) to populate the raster values with

downsample

integer: if larger than 0, downsample with this rate (number of pixels to skip in every row/column)

Details

if curvilinear is a stars object with longitude and latitude values, its coordinate reference system is typically not that of the latitude and longitude values.