R: Spatial Data Analysis

# Spatial Data Analysis

## Documentation for package ‘terra’ version 1.2-5

- DESCRIPTION file.

## Help Pages

A B C D E F G H I L M N O P Q R S T U V W X Y Z misc

terra-package | The terra package

## -- A --

add<- | Add (in place) a SpatRaster to another SpatRaster object
add<--method | Add (in place) a SpatRaster to another SpatRaster object
adjacent | Adjacent cells
adjacent-method | Adjacent cells
aggregate | Aggregate raster or vector data
aggregate-method | Aggregate raster or vector data
align | Align a SpatExtent
align-method | Align a SpatExtent
animate | Animate a SpatRaster
animate-method | Animate a SpatRaster
app | Apply a function to the cells of a SpatRaster
app-method | Apply a function to the cells of a SpatRaster
area | Area and perimeter
area-method | Area and perimeter
Arith-method | Arithmetic, logical and general mathematical methods
Arith-methods | Arithmetic, logical and general mathematical methods
as.array | Coercion of a SpatRaster to other object types
as.array-method | Coercion of a SpatRaster to other object types
as.character-method | Create a text representation of (the skeleton of) an object
as.contour | Contour plot
as.contour-method | Contour plot
as.data.frame | SpatRaster or SpatVector to data.frame
as.data.frame-method | SpatRaster or SpatVector to data.frame
as.lines | Coercion to a SpatVector, or to another SpatVector type
as.lines-method | Coercion to a SpatVector, or to another SpatVector type
as.list | SpatRaster or SpatVector to data.frame
as.list-method | SpatRaster or SpatVector to data.frame
as.logical-method | Arithmetic, logical and general mathematical methods
as.matrix | Coercion of a SpatRaster to other object types
as.matrix-method | Coercion of a SpatRaster to other object types
as.points | Coercion to a SpatVector, or to another SpatVector type
as.points-method | Coercion to a SpatVector, or to another SpatVector type
as.polygons | Coercion to a SpatVector, or to another SpatVector type
as.polygons-method | Coercion to a SpatVector, or to another SpatVector type
as.raster | Coerce to a "raster" object
as.raster-method | Coerce to a "raster" object
as.vector | Coercion of a SpatRaster to other object types
as.vector-method | Coercion of a SpatRaster to other object types
atan2 | Two argument arc-tangent
atan2-method | Two argument arc-tangent
autocor | Spatial autocorrelation
autocor-method | Spatial autocorrelation

## -- B --

barplot | Bar plot of a SpatRaster
barplot-method | Bar plot of a SpatRaster
bbox-method | Create, get or set a SpatExtent
boundaries | Detect boundaries (edges)
boundaries-method | Detect boundaries (edges)
boxplot | Box plot of SpatRaster data
boxplot-method | Box plot of SpatRaster data
buffer | Create a buffer around vector objects or raster patches
buffer-method | Create a buffer around vector objects or raster patches

## -- C --

c | Combine SpatRaster or SpatVector objects
c-method | Combine SpatRaster or SpatVector objects
cartogram | Cartogram
cartogram-method | Cartogram
cats | Factors
cats-method | Factors
cellFromRowCol | Coordinates from a row, column or cell number and vice versa
cellFromRowCol-method | Coordinates from a row, column or cell number and vice versa
cellFromRowColCombine | Coordinates from a row, column or cell number and vice versa
cellFromRowColCombine-method | Coordinates from a row, column or cell number and vice versa
cellFromXY | Coordinates from a row, column or cell number and vice versa
cellFromXY-method | Coordinates from a row, column or cell number and vice versa
cells | Get cell numbers
cells-method | Get cell numbers
centroids | Get centroids
centroids-method | Get centroids
clamp | Clamp values
clamp-method | Clamp values
classify | Classify (or reclassify) cell values
classify-method | Classify (or reclassify) cell values
click | Query by clicking on a map
click-method | Query by clicking on a map
colFromCell | Coordinates from a row, column or cell number and vice versa
colFromCell-method | Coordinates from a row, column or cell number and vice versa
colFromX | Coordinates from a row, column or cell number and vice versa
colFromX-method | Coordinates from a row, column or cell number and vice versa
coltab | Color table
coltab-method | Color table
coltab<- | Color table
coltab<--method | Color table
Compare-method | Arithmetic, logical and general mathematical methods
Compare-methods | Arithmetic, logical and general mathematical methods
compareGeom | Compare geometries of SpatRasters
compareGeom-method | Compare geometries of SpatRasters
contour | Contour plot
contour-method | Contour plot
convexhull | Convex hull
convexhull-method | Convex hull
coords | Get the coordinates of SpatVector geometries or SpatRaster cells
coords-method | Get the coordinates of SpatVector geometries or SpatRaster cells
copy | Deep copy
copy-method | Deep copy
cover | Replace values with values from another object
cover-method | Replace values with values from another object
crop | Cut out a geographic subset
crop-method | Cut out a geographic subset
crosstab | Cross-tabulate
crosstab-method | Cross-tabulate
crs | Get or set a coordinate reference system
crs-method | Get or set a coordinate reference system
crs<- | Get or set a coordinate reference system
crs<--method | Get or set a coordinate reference system

## -- D --

datatype | Geometry type of a SpatVector
datatype-method | Geometry type of a SpatVector
delauny | voronoi diagram and delauny triangles
delauny-method | voronoi diagram and delauny triangles
density | Density plot
density-method | Density plot
depth | depth of SpatRaster layers
depth-method | depth of SpatRaster layers
depth<- | depth of SpatRaster layers
depth<--method | depth of SpatRaster layers
desc | describe
describe | describe
describe-method | describe
diff | diff
diff-method | diff
dim | Dimensions of a SpatRaster or SpatVector and related objects
dim-method | Dimensions of a SpatRaster or SpatVector and related objects
dim<--method | Dimensions of a SpatRaster or SpatVector and related objects
disaggregate | Disaggregate raster cells
disaggregate-method | Disaggregate raster cells
distance | Geographic distance
distance-method | Geographic distance
dots | Make a dot-density map
dots-method | Make a dot-density map
draw | Draw a polygon, line, extent, or points
draw-method | Draw a polygon, line, extent, or points

## -- E --

erase | Erase parts of a SpatVector object
erase-method | Erase parts of a SpatVector object
expand | Extend
expand-method | Extend
ext | Create, get or set a SpatExtent
ext-method | Create, get or set a SpatExtent
ext<- | Create, get or set a SpatExtent
ext<--method | Create, get or set a SpatExtent
extend | Extend
extend-method | Extend
extract | Extract values from a SpatRaster
extract-method | Extract values from a SpatRaster

## -- F --

fillHoles | Remove holes from polygons
fillHoles-method | Remove holes from polygons
flip | Flip or reverse a raster
flip-method | Flip or reverse a raster
focal | Focal values
focal-method | Focal values
focalMat | Focal weights matrix
focalValues | Get focal values
focalValues-method | Get focal values
freq | Frequency table
freq-method | Frequency table

## -- G --

gdal | gdal utilities
gdal_version | gdal utilities
geom | Get the geometry (coordinates) of a SpatVector
geom-method | Get the geometry (coordinates) of a SpatVector
geomtype | Geometry type of a SpatVector
geomtype-method | Geometry type of a SpatVector
global | global statistics
global-method | global statistics

## -- H --

hasValues | Data sources of a SpatRaster
hasValues-method | Data sources of a SpatRaster
head | Show the head or tail of a Spat* object
head-method | Show the head or tail of a Spat* object
hist | Histogram
hist-method | Histogram

## -- I --

ifel | ifelse for SpatRasters
ifel-method | ifelse for SpatRasters
image | SpatRaster image method
image-method | SpatRaster image method
init | Initialize a SpatRaster with values
init-method | Initialize a SpatRaster with values
inset | Make an inset map
inset-method | Make an inset map
interpolate | Interpolate
interpolate-method | Interpolate
intersect | Intersection
intersect-method | Intersection
is.factor | Factors
is.factor-method | Factors
is.finite-method | Arithmetic, logical and general mathematical methods
is.infinite-method | Arithmetic, logical and general mathematical methods
is.lines | Geometry type of a SpatVector
is.lines-method | Geometry type of a SpatVector
is.lonlat | Check for longitude/latitude crs
is.lonlat-method | Check for longitude/latitude crs
is.na-method | Arithmetic, logical and general mathematical methods
is.nan-method | Arithmetic, logical and general mathematical methods
is.points | Geometry type of a SpatVector
is.points-method | Geometry type of a SpatVector
is.polygons | Geometry type of a SpatVector
is.polygons-method | Geometry type of a SpatVector
is.valid | Check polygon validity
is.valid-method | Check polygon validity
isFALSE-method | Arithmetic, logical and general mathematical methods
isLonLat | Check for longitude/latitude crs
isLonLat-method | Check for longitude/latitude crs
isTRUE-method | Arithmetic, logical and general mathematical methods

## -- L --

lapp | Apply a function to layers of a SpatRaster, or sub-datasets of a SpatRasterDataset
lapp-method | Apply a function to layers of a SpatRaster, or sub-datasets of a SpatRasterDataset
length | Dimensions of a SpatRaster or SpatVector and related objects
length-method | Dimensions of a SpatRaster or SpatVector and related objects
levels | Factors
levels-method | Factors
levels<- | Factors
levels<--method | Factors
linearUnits | Linear units of the coordinate reference system
linearUnits-method | Linear units of the coordinate reference system
lines | Add SpatVector data to a map
lines-method | Add SpatVector data to a map
log | Arithmetic, logical and general mathematical methods
log-method | Arithmetic, logical and general mathematical methods
Logic-method | Arithmetic, logical and general mathematical methods
Logic-methods | Arithmetic, logical and general mathematical methods
longnames | Names of Spat* objects
longnames-method | Names of Spat* objects
longnames<- | Names of Spat* objects
longnames<--method | Names of Spat* objects

## -- M --

mask | Mask values in a SpatRaster
mask-method | Mask values in a SpatRaster
match | Value matching for SpatRasters
match-method | Value matching for SpatRasters
Math-method | Arithmetic, logical and general mathematical methods
Math-methods | Arithmetic, logical and general mathematical methods
Math2-method | Arithmetic, logical and general mathematical methods
Math2-methods | Arithmetic, logical and general mathematical methods
max | Summarize
max-method | Summarize
mean | Summarize
mean-method | Summarize
median | Summarize
median-method | Summarize
merge | Merge SpatRaster or SpatExtent objects, or a SpatVector with a data.frame
merge-method | Merge SpatRaster or SpatExtent objects, or a SpatVector with a data.frame
min | Summarize
min-method | Summarize
minmax | Get or compute the minimum and maximum cell values
minmax-method | Get or compute the minimum and maximum cell values
modal | modal value
modal-method | modal value
mosaic | mosaic SpatRasters
mosaic-method | mosaic SpatRasters

## -- N --

NAflag | Set the NA flag
NAflag-method | Set the NA flag
NAflag<- | Set the NA flag
NAflag<--method | Set the NA flag
name | Names of Spat* objects
name<- | Names of Spat* objects
names | Names of Spat* objects
names-method | Names of Spat* objects
names<- | Names of Spat* objects
names<--method | Names of Spat* objects
ncell | Dimensions of a SpatRaster or SpatVector and related objects
ncell-method | Dimensions of a SpatRaster or SpatVector and related objects
ncol | Dimensions of a SpatRaster or SpatVector and related objects
ncol-method | Dimensions of a SpatRaster or SpatVector and related objects
ncol<- | Dimensions of a SpatRaster or SpatVector and related objects
ncol<--method | Dimensions of a SpatRaster or SpatVector and related objects
near | nearby geometries
near-method | nearby geometries
nearby | nearby geometries
nearby-method | nearby geometries
nearest | nearby geometries
nearest-method | nearby geometries
nlyr | Dimensions of a SpatRaster or SpatVector and related objects
nlyr-method | Dimensions of a SpatRaster or SpatVector and related objects
nlyr<- | Dimensions of a SpatRaster or SpatVector and related objects
nlyr<--method | Dimensions of a SpatRaster or SpatVector and related objects
nrow | Dimensions of a SpatRaster or SpatVector and related objects
nrow-method | Dimensions of a SpatRaster or SpatVector and related objects
nrow<- | Dimensions of a SpatRaster or SpatVector and related objects
nrow<--method | Dimensions of a SpatRaster or SpatVector and related objects
nsrc | Dimensions of a SpatRaster or SpatVector and related objects
nsrc-method | Dimensions of a SpatRaster or SpatVector and related objects

## -- O --

origin | Origin
origin-method | Origin

## -- P --

pack | pack a SpatRaster or SpatVector object
pack-method | pack a SpatRaster or SpatVector object
PackedSpatRaster-class | SpatRaster class
PackedSpatVector-class | Class "SpatVector"
pairs | Pairs plot (matrix of scatterplots)
pairs-method | Pairs plot (matrix of scatterplots)
patches | Detect patches (clumps) of cells
patches-method | Detect patches (clumps) of cells
perimeter | Area and perimeter
perimeter-method | Area and perimeter
persp | Perspective plot
persp-method | Perspective plot
plot | Make a map
plot-method | Make a map
plot-method | Scatterplot of two SpatRaster layers
plotRGB | Red-Green-Blue plot of a multi-layered SpatRaster
plotRGB-method | Red-Green-Blue plot of a multi-layered SpatRaster
points | Add SpatVector data to a map
points-method | Add SpatVector data to a map
polys | Add SpatVector data to a map
polys-method | Add SpatVector data to a map
predict | Spatial model predictions
predict-method | Spatial model predictions
project | Change the coordinate reference system
project-method | Change the coordinate reference system

## -- Q --

quantile | SpatRaster local quantiles
quantile-method | SpatRaster local quantiles

## -- R --

range-method | Summarize
rapp | Range-Apply
rapp-method | Range-Apply
rast | Create a SpatRaster
rast-method | Create a SpatRaster
rasterize | Rasterize vector data
rasterize-method | Rasterize vector data
RasterSource | SpatRaster class
RasterSource-class | SpatRaster class
Rcpp_RasterSource-class | SpatRaster class
Rcpp_SpatCategories-class | SpatRaster class
Rcpp_SpatExtent-class | Class "SpatExtent"
Rcpp_SpatRaster-class | SpatRaster class
Rcpp_SpatVector-class | Class "SpatVector"
readStart | Read from, or write to, file
readStart-method | Read from, or write to, file
readStop | Read from, or write to, file
readStop-method | Read from, or write to, file
readValues | Read from, or write to, file
readValues-method | Read from, or write to, file
rectify | rectify a SpatRaster
rectify-method | rectify a SpatRaster
relate | relate
relate-method | relate
rep | Replicate layers
rep-method | Replicate layers
res | Dimensions of a SpatRaster or SpatVector and related objects
res-method | Dimensions of a SpatRaster or SpatVector and related objects
res<- | Dimensions of a SpatRaster or SpatVector and related objects
res<--method | Dimensions of a SpatRaster or SpatVector and related objects
resample | Transfer values of a SpatRaster to another one with a different geometry
resample-method | Transfer values of a SpatRaster to another one with a different geometry
rescale | rescale
rescale-method | rescale
rev | Flip or reverse a raster
rev-method | Flip or reverse a raster
RGB | Declare RGB channels
RGB-method | Declare RGB channels
RGB<- | Declare RGB channels
RGB<--method | Declare RGB channels
rotate | Rotate a SpatRaster along longitude
rotate-method | Rotate a SpatRaster along longitude
rowColFromCell | Coordinates from a row, column or cell number and vice versa
rowColFromCell-method | Coordinates from a row, column or cell number and vice versa
rowFromCell | Coordinates from a row, column or cell number and vice versa
rowFromCell-method | Coordinates from a row, column or cell number and vice versa
rowFromY | Coordinates from a row, column or cell number and vice versa
rowFromY-method | Coordinates from a row, column or cell number and vice versa

## -- S --

sapp | Apply a terra function that takes only a single layer to all layers
sapp-method | Apply a terra function that takes only a single layer to all layers
sbar | scalebar
scale | Scale values
scale-method | Scale values
sds | Create a SpatRasterDataset
sds-method | Create a SpatRasterDataset
segregate | separate
segregate-method | separate
sel | Spatial selection
sel-method | Spatial selection
selectRange | Select the values of a range of layers, as specified by cell values in another SpatRaster
selectRange-method | Select the values of a range of layers, as specified by cell values in another SpatRaster
separate | separate
separate-method | separate
setCats | Factors
setCats-method | Factors
setMinMax | Get or compute the minimum and maximum cell values
setMinMax-method | Get or compute the minimum and maximum cell values
setValues | Set the values of raster cells or of geometry attributes
setValues-method | Set the values of raster cells or of geometry attributes
shift | Shift
shift-method | Shift
show-method | Class "SpatExtent"
show-method | SpatRaster class
show-method | Class "SpatVector"
size | Dimensions of a SpatRaster or SpatVector and related objects
size-method | Dimensions of a SpatRaster or SpatVector and related objects
sources | Data sources of a SpatRaster
sources-method | Data sources of a SpatRaster
SpatCategories | SpatRaster class
SpatCategories-class | SpatRaster class
SpatExtent | Class "SpatExtent"
SpatExtent-class | Class "SpatExtent"
SpatRaster | SpatRaster class
SpatRaster-class | SpatRaster class
spatSample | Take a regular sample
spatSample-method | Take a regular sample
SpatVector | Class "SpatVector"
SpatVector-class | Class "SpatVector"
spin | spin a SpatVector
spin-method | spin a SpatVector
stdev | Summarize
stdev-method | Summarize
stretch | Stretch
stretch-method | Stretch
subset | Subset of a SpatRaster
subset-method | Subset of a SpatVector
subset-method | Subset of a SpatRaster
subst | replace cell values
subst-method | replace cell values
summary | summary
Summary-method | Summarize
summary-method | summary
Summary-methods | Summarize
svc | Create a SpatVectorCollection
svc-method | Create a SpatVectorCollection
symdif | Symetrical difference
symdif-method | Symetrical difference

## -- T --

t | Transpose
t-method | Transpose
tail | Show the head or tail of a Spat* object
tail-method | Show the head or tail of a Spat* object
tapp | Apply a function to subsets of layers of a SpatRaster
tapp-method | Apply a function to subsets of layers of a SpatRaster
terra | The terra package
terrain | terrain characteristic
terrain-method | terrain characteristic
terraOptions | Options
text | Add labels to a map
text-method | Add labels to a map
tighten | tighten SpatRaster or SpatRasterDataset objects
tighten-method | tighten SpatRaster or SpatRasterDataset objects
tiles | Make tiles
tiles-method | Make tiles
time | time of SpatRaster layers
time-method | time of SpatRaster layers
time<- | time of SpatRaster layers
time<--method | time of SpatRaster layers
tmpFiles | Temporary files
trans | Transpose
trans-method | Transpose
trim | Trim a SpatRaster
trim-method | Trim a SpatRaster

## -- U --

union | Union SpatVector or SpatExtent objects
union-method | Union SpatVector or SpatExtent objects
unique | Unique values
unique-method | Unique values
units | units of SpatRaster or SpatRasterDataSet
units-method | units of SpatRaster or SpatRasterDataSet
units<- | units of SpatRaster or SpatRasterDataSet
units<--method | units of SpatRaster or SpatRasterDataSet

## -- V --

values | Cell values and geometry attributes
values-method | Cell values and geometry attributes
values<- | Set the values of raster cells or of geometry attributes
values<--method | Set the values of raster cells or of geometry attributes
varnames | Names of Spat* objects
varnames-method | Names of Spat* objects
varnames<- | Names of Spat* objects
varnames<--method | Names of Spat* objects
vect | Create SpatVector objects
vect-method | Create SpatVector objects
voronoi | voronoi diagram and delauny triangles
voronoi-method | voronoi diagram and delauny triangles
vrt | Virtual Raster Tiles
vrt-method | Virtual Raster Tiles

## -- W --

weighted.mean | Weighted mean of layers
weighted.mean-method | Weighted mean of layers
which.lyr | Which cells are TRUE?
which.lyr-method | Which cells are TRUE?
which.max | Summarize
which.max-method | Summarize
which.min | Summarize
which.min-method | Summarize
window | Set a window
window-method | Set a window
window<- | Set a window
window<--method | Set a window
wrap | pack a SpatRaster or SpatVector object
wrap-method | pack a SpatRaster or SpatVector object
writeCDF | Write raster data to a NetCDF file
writeCDF-method | Write raster data to a NetCDF file
writeRaster | Write raster data to a file
writeRaster-method | Write raster data to a file
writeStart | Read from, or write to, file
writeStart-method | Read from, or write to, file
writeStop | Read from, or write to, file
writeStop-method | Read from, or write to, file
writeValues | Read from, or write to, file
writeValues-method | Read from, or write to, file
writeVector | Write SpatVector data to a file
writeVector-method | Write SpatVector data to a file

## -- X --

xFromCell | Coordinates from a row, column or cell number and vice versa
xFromCell-method | Coordinates from a row, column or cell number and vice versa
xFromCol | Coordinates from a row, column or cell number and vice versa
xFromCol-method | Coordinates from a row, column or cell number and vice versa
xmax | Get or set single values of an extent
xmax-method | Get or set single values of an extent
xmax<- | Get or set single values of an extent
xmax<--method | Get or set single values of an extent
xmin | Get or set single values of an extent
xmin-method | Get or set single values of an extent
xmin<- | Get or set single values of an extent
xmin<--method | Get or set single values of an extent
xres | Dimensions of a SpatRaster or SpatVector and related objects
xres-method | Dimensions of a SpatRaster or SpatVector and related objects
xyFromCell | Coordinates from a row, column or cell number and vice versa
xyFromCell-method | Coordinates from a row, column or cell number and vice versa

## -- Y --

yFromCell | Coordinates from a row, column or cell number and vice versa
yFromCell-method | Coordinates from a row, column or cell number and vice versa
yFromRow | Coordinates from a row, column or cell number and vice versa
yFromRow-method | Coordinates from a row, column or cell number and vice versa
ymax | Get or set single values of an extent
ymax-method | Get or set single values of an extent
ymax<- | Get or set single values of an extent
ymax<--method | Get or set single values of an extent
ymin | Get or set single values of an extent
ymin-method | Get or set single values of an extent
ymin<- | Get or set single values of an extent
ymin<--method | Get or set single values of an extent
yres | Dimensions of a SpatRaster or SpatVector and related objects
yres-method | Dimensions of a SpatRaster or SpatVector and related objects

## -- Z --

zonal | Zonal statistics
zonal-method | Zonal statistics
zoom | Zoom in on a map
zoom-method | Zoom in on a map

## -- misc --

!-method | Arithmetic, logical and general mathematical methods
$ | Get or replace attribute values of a SpatVector
$-method | Create, get or set a SpatExtent
$-method | Get or replace attribute values of a SpatVector
$-method | Subset of a SpatRaster
$<- | Get or replace attribute values of a SpatVector
$<--method | Create, get or set a SpatExtent
$<--method | Get or replace attribute values of a SpatVector
$<--method | Replace values of a SpatRaster
%in% | Value matching for SpatRasters
%in%-method | Value matching for SpatRasters
[-method | Create, get or set a SpatExtent
[-method | Extract values from a SpatRaster
[-method | Replace values of a SpatRaster
[-method | Subset of a SpatVector
[-method | Subset of a SpatRaster
[-method | Create a SpatVectorCollection
[<--method | Create, get or set a SpatExtent
[<--method | Replace values of a SpatRaster
[<--method | Create a SpatRasterDataset
[<--method | Create a SpatVectorCollection
[[-method | Get or replace attribute values of a SpatVector
[[-method | Subset of a SpatRaster
[[-method | Create a SpatVectorCollection
[[<--method | Get or replace attribute values of a SpatVector
[[<--method | Replace values of a SpatRaster