Package: stars 0.7-3

Edzer Pebesma

stars: Spatiotemporal Arrays, Raster and Vector Data Cubes

Reading, manipulating, writing and plotting spatiotemporal arrays (raster and vector data cubes) in 'R', using 'GDAL' bindings provided by 'sf', and 'NetCDF' bindings by 'ncmeta' and 'RNetCDF'.

Authors:Edzer Pebesma [aut, cre], Michael Sumner [ctb], Etienne Racine [ctb], Adriano Fantini [ctb], David Blodgett [ctb], Krzysztof Dyba [ctb]

stars_0.7-3.tar.gz
stars_0.7-3.zip(r-4.7)stars_0.7-3.zip(r-4.6)stars_0.7-3.zip(r-4.5)
stars_0.7-3.tgz(r-4.6-any)stars_0.7-3.tgz(r-4.5-any)
stars_0.7-3.tar.gz(r-4.7-any)stars_0.7-3.tar.gz(r-4.6-any)
stars_0.7-3.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
stars/json (API)

# Install 'stars' in R:
install.packages('stars', repos = c('https://fastverse.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/r-spatial/stars/issues

Pkgdown/docs site:https://r-spatial.github.io

Datasets:
  • bcsd_obs - Monthly Gridded Meteorological Observations
  • L7_ETMs - Landsat-7 bands for a selected region around Olinda, BR
  • stars_sentinel2 - Sentinel-2 sample tile

On CRAN:

Conda:

rastersatellite-imagesspatial

18.17 score 608 stars 172 packages 6.8k scripts 49k downloads 5 mentions 37 exports 8 dependencies

Last updated from:24a8342c35. Checks:7 WARNING, 2 OK. Indexed: no.

TargetResultTimeFilesSyslog
linux-devel-x86_64WARNING373
source / vignettesOK436
linux-release-x86_64WARNING390
macos-release-arm64WARNING334
macos-oldrel-arm64WARNING264
windows-develWARNING480
windows-releaseWARNING307
windows-oldrelWARNING341
wasm-releaseOK271

Exports:%in%as.tbl_cube.starsdetect.driverexpand_dimensionsgeom_starsmake_intervalsread_mdimread_ncdfread_starsst_applyst_as_starsst_cellsst_contourst_dim_to_attrst_dimensionsst_dimensions<-st_downsamplest_extractst_flipst_geotransformst_geotransform<-st_get_dimension_valuesst_mosaicst_raster_typest_rasterizest_redimensionst_resst_rgbst_rotatest_set_bboxst_set_dimensionsst_sfc2xyst_tilest_warpst_xy2sfcwrite_mdimwrite_stars

Dependencies:abindDBIRcpprlangs2sfunitswk

stars proxy objects
Preamble: the starsdata package | Reading chunks, change resolution, select bands | Reading a particular chunk | Reading at a different resolution | Stars proxy objects | Methods for stars proxy objects | Select attributes | Select an area | Lazy evaluation, changing evaluation order | Fetching the data | Plotting with changed evaluation order | Multi-resolution proxy objects

Last update: 2026-03-16
Started: 2019-02-07

stars tidyverse methods
slice | filter | pull | mutate | select | geom_stars

Last update: 2026-03-16
Started: 2019-02-07

vector-raster conversions, reprojection, warping
Rasterizing an sf vector object | Vectorizing a raster object to an sf object | Polygonizing | Exporting to points | Exporting to polygons | Switching between vector and raster in stars objects | Reprojecting a raster | Warping a raster

Last update: 2026-03-16
Started: 2019-02-07

How raster functions map to stars functions
COMMENT LEGEND | Creating objects | Changing spatial extent and/or resolution of objects | Cell based computation | Spatial contextual computation | Model predictions | Data type conversion | Summarizing | Accessing values of objects | Plotting | Getting and setting dimensions | Computing row, column, cell numbers and coordinates

Last update: 2026-03-16
Started: 2020-09-22

Statistical modelling with stars objects
Training and prediction with stars objects | stars objects as data.frames | Predict for stars objects | models fitted for every pixel | Linear regression on pixel time series | Unsupervised learners | Principal components | K-means clustering | Supervised learners | Random Forest land use classification | Parallel processing

Last update: 2026-03-16
Started: 2020-12-31

introduction
Reading a satellite image | Switching attributes to dimensions and back | Subsetting | Overviews | Reading a raster time series: NetCDF | Reading datasets from multiple files | Writing stars objects to disk | Cropping a raster's extent | Vector data cube example | OD: space x space x travel mode x time x time | Extracting at point locations, aggregating over polygons

Last update: 2025-06-23
Started: 2019-02-07

stars data model
Stars objects | Grid type | Regular grids | Raster attributes, rotated and sheared grids | Rectilinear grids | Curvilinear grids

Last update: 2025-06-23
Started: 2019-02-07

NetCDF Proxy Workflows

Last update: 2022-12-29
Started: 2022-03-08

Readme and manuals

Help Manual

Help pageTopics
evaluate whether cube values are in a given set%in%,stars-method
spatially or temporally aggregate stars objectaggregate aggregate.stars
Coerce stars object into a Raster raster or brickas coerce,stars,Raster-method coerce,stars,Terra-method coerce,stars_proxy,Raster-method coerce,stars_proxy,Terra-method
Monthly Gridded Meteorological Observationsbcsd_obs
combine multiple stars objects, or combine multiple attributes in a single stars object into a single arrayc.stars c.stars_proxy
plot contours of a stars objectcontour.stars
cut methods for stars objectscut.array cut.matrix cut.stars cut_stars
dplyr verbs for stars objectsas.tbl_cube.stars dplyr filter.stars filter.stars_proxy mutate.stars mutate.stars_proxy pull.stars pull.stars_proxy rename.stars rename.stars_proxy replace_na.stars replace_na.stars_proxy select.stars select.stars_proxy slice.stars slice.stars_proxy transmute.stars transmute.stars_proxy
expand the dimension values into a listexpand_dimensions expand_dimensions.dimensions
ggplot geom for stars objectsgeom_stars theme_stars
Landsat-7 bands for a selected region around Olinda, BRL7_ETMs
create an intervals objectmake_intervals
Read or write data using GDAL's multidimensional array APImdim read_mdim write_mdim
merge or split stars objectmerge merge.stars split split.stars
S3 Ops Group Generic Functions for stars objectsMath.stars Math.stars_proxy Ops.stars Ops.stars_proxy ops_stars
plot stars object, with subplots for each level of first non-spatial dimensionimage.stars plot plot.nc_proxy plot.stars plot.stars_proxy
Principal components of stars objectprcomp prcomp.stars prcomp.stars_proxy
Predict values, given a model object, for a stars or stars_proxy objectpredict.stars predict.stars_proxy
print stars or dimensions objectas.data.frame.dimensions print.dimensions print.stars print_stars
Read NetCDF into stars objectread_ncdf
read raster/array dataset from file or connectionread_stars
redimension array, or collapse attributes into a new dimensionredimension st_redimension st_redimension.stars st_redimension.stars_proxy
st_apply apply a function to one or more array dimensionsst_apply st_apply.stars
Convert stars object into an sf objectst_as_sf st_as_sf.stars st_as_sf.stars_proxy st_as_sfc.stars
convert objects into a stars objectst_as_stars st_as_stars.bbox st_as_stars.CFDataset st_as_stars.CFVariable st_as_stars.cubble_df st_as_stars.data.frame st_as_stars.default st_as_stars.list st_as_stars.ncdfgeom st_as_stars.OpenStreetMap st_as_stars.Raster st_as_stars.sf st_as_stars.SpatRaster st_as_stars.stars st_as_stars.stars_proxy st_as_stars.xts
return the cell index corresponding to the location of a set of pointsst_cells
Compute or plot contour lines or setsst_contour
retrieve coordinates for raster or vector cube cellsas.data.frame.stars as_tibble.stars st_coordinates st_coordinates.stars
crop a stars objectst_crop st_crop.mdim st_crop.stars st_crop.stars_proxy
create an array with dimension valuesst_dim_to_attr
get dimensions from stars objectst_dimensions st_dimensions.array st_dimensions.default st_dimensions.stars st_dimensions<- st_dimensions<-.list st_dimensions<-.stars st_dimensions<-.stars_proxy st_get_dimension_values st_set_dimensions
downsample stars or stars_proxy objectsst_downsample st_downsample.stars st_downsample.stars_proxy
Extract cell values at point locationsst_extract st_extract.stars
get or set the geotransform, or rotation matrixst_geotransform st_geotransform<- st_geotransform<-.stars
spatial intersect predicate for stars and sfc objectst_intersects.stars
Spatially join a stars and an `sf` objectst_join.stars
build mosaic (composite) of several spatially disjoint stars objectsst_mosaic st_mosaic.character st_mosaic.stars st_mosaic.stars_proxy
Move raster offset such that grid start at row/col (1,1)st_normalize st_normalize.stars st_normalize.stars_proxy
get the raster type (if any) of a stars objectst_raster_type
rasterize simple feature geometriesst_rasterize
obtain (spatial) resolution of a stars objectst_res
reduce dimension to rgb (alpha) hex valuesst_rgb
Transform rotated pole long/lat regular grid to unrotated curvilinear gridst_rotate st_rotate.sf st_rotate.sfc st_rotate.stars
set bounding box parameters of regular gridst_set_bbox
Specify parameters to load raster in blocksst_tile
transform geometries in stars objects to a new coordinate reference system, without warpingst_transform st_transform.stars st_transform_proj.stars
Warp (resample) grids in stars objects to a new grid, possibly in an new coordinate reference systemst_warp
replace x y raster dimensions with simple feature geometry list (points, or polygons = rasterize) and vice versast_sfc2xy st_xy2sfc
Sentinel-2 sample tilestars_sentinel2
subset stars objectsstars_subset st_flip [.stars [<-.stars [<-.stars_proxy
write stars object to gdal dataset (typically: to file)detect.driver write_stars write_stars.stars write_stars.stars_proxy