terra1.8-10 package

Spatial Data Analysis

activeCat

Active category

add_mtext

draw a box

add

Add (in place) a SpatRaster to another SpatRaster or to a SpatRasterDa...

adjacent

Adjacent cells

aggregate

Aggregate raster or vector data

align

Align a SpatExtent

all.equal

Compare two SpatRasters for equality

animate

Animate a SpatRaster

app

Apply a function to the cells of a SpatRaster

approximate

Estimate values for cell values that are NA by interpolating between...

arith-generic

Arithmetic

as.character

Create a text representation of (the skeleton of) an object

as.data.frame

SpatRaster or SpatVector to data.frame

as.lines

Conversion to a SpatVector of lines

as.list

Coerce a Spat* object to a list

as.points

Conversion to a SpatVector of points

as.polygons

Conversion to a SpatVector of polygons

as.raster

Coerce to a "raster" object

atan2

Two argument arc-tangent

autocor

Spatial autocorrelation

barplot

Bar plot of a SpatRaster

bestMatch

bestMatch

boundaries

Detect boundaries (edges)

box

draw a box

boxplot

Box plot of SpatRaster data

buffer

Create a buffer around vector geometries or raster patches

c

Combine SpatRaster or SpatVector objects

cartogram

Cartogram

catalyze

Factors to numeric

cells

Get cell numbers

cellSize

Area covered by each raster cell

centroids

Centroids

clamp_ts

clamp time series data

clamp

Clamp values

classify

Classify (or reclassify) cell values

click

Query by clicking on a map

coerce

Coercion to vector, matrix or array

collapse

tighten SpatRaster or SpatRasterDataset objects

colors

Color table

combineGeoms

Combine geometries

compare-generics

Compare and logical methods

compareGeom

Compare geometries

concats

Concatenate categorical rasters

contour

Contour plot

convhull

Convex, concave, rectangular and circular hulls

costDist

Cost-distance

cover

Replace values with values from another object

crds

Get the coordinates of SpatVector geometries or SpatRaster cells

crop

Cut out a geographic subset

crosstab

Cross-tabulate

crs

Get or set a coordinate reference system

datatype

Data type of a SpatRaster or SpatVector

deepcopy

Deep copy

densify

Add additional nodes to lines or polygons

density

Density plot

deprecated

deprecated methods

depth

depth of SpatRaster layers

describe

describe

diff

Lagged differences

dimensions

Dimensions of a SpatRaster or SpatVector and related objects

direction

Direction

disaggregate

Disaggregate raster cells or vector geometries

distance

Geographic distance

divide

Subdivide a raster or polygons

dots

Make a dot-density map

draw

Draw a polygon, line, extent, or points

elongate

elongate lines

erase

Erase parts of a SpatVector object

expanse

Get the expanse (area) of individual polygons or for all (summed) rast...

ext

Create, get or set a SpatExtent

extend

Extend

extract

Extract values from a SpatRaster

extractAlong

extract values along lines

extractRange

Extract values for a range of layers from a SpatRaster

factors

Categorical rasters

fill

Remove holes from polygons

fillTime

Fill time gaps in a SpatRaster

flip

Flip or reverse a raster

flowAccumulation

Flow accumulation

focal

Focal values

focal3D

Three-dimensional focal values

focalCpp

Compute focal values with an iterating C++ function

focalMat

Focal weights matrix

focalPairs

Focal function across two layers

focalReg

Focal regression

focalValues

Get focal values

forceCCW

force counter-clockwise polygons

freq

Frequency table

gaps

Find gaps between polygons

gdal

GDAL version, supported file formats, and cache size

geometry

Get the geometry (coordinates) of a SpatVector

geomtype

Geometry type of a SpatVector

global

global statistics

graticule

Create a graticule

grid

add a grid to a map made with terra

gridDist

Distance on a grid

halo

Add halo-ed text to a plot

headtail

head and tail of a SpatRaster or SpatVector

hist

Histogram

identical

Compare two SpatRasters for equality

ifelse

ifelse for SpatRasters

image

SpatRaster image method

impose

Impose the geometry of a SpatRaster to those in a SpatRasterCollection...

init

Initialize a SpatRaster with values

inplace

Change values in-place

inset

Make an inset map

interpIDW

Interpolate points using a moving window

interpNear

Nearest neighbor interpolation

interpolate

Spatial interpolation

intersect

Intersection

is.bool

Raster value types

is.empty

Check if a SpatExtent or SpatVector is empty

is.lonlat

Check for longitude/latitude crs

is.rotated

Check for rotation

is.valid

Check or fix polygon or extent validity

k_means

k_means

lapp

Apply a function to layers of a SpatRaster, or sub-datasets of a SpatR...

layerCor

Correlation and (weighted) covariance

legend

add a custom legend

linearUnits

Linear units of the coordinate reference system

lines

Add points, lines, or polygons to a map

makeTiles

Make tiles or get their extents

makeVRT

Make a VRT header file

map_extent

Get the coordinates of the extent of a map

mappal

color palettes for mapping

mask

Mask values in a SpatRaster or SpatVector

match

Value matching for SpatRasters

math-generics

General mathematical methods

mem

Memory available and needed

merge

Merge SpatRasters, or merge a SpatVector with a data.frame

mergeTime

merge SpatRasters by timelines to create a single timeseries

meta

meta

metags

Set or get metadata

minmax

Get or compute the minimum and maximum cell values

modal

modal value

mosaic

mosaic SpatRasters

na.omit

Find and remove geometries that are NA

NAflag

Set the NA flag

names

Names of Spat* objects

nearby

nearby geometries

NIPD

Number of immediate adjacent cells flowing into each cell

normalize.longitude

normalize vector data that crosses the dateline

north

North arrow

not.na

is not NA

nseg

Number of segments

origin

Origin

pairs

Pairs plot (matrix of scatterplots)

panel

Map panel

patches

Detect patches (clumps) of cells

perim

Perimeter or length

persp

Perspective plot

pitfinder

Pit Finder in a Flow Dir SpatRaster for Watershed Extraction

plet

Plot with leaflet

plot_extent

Plot a SpatExtent

plot_graticule

Plot a graticule

plot

Make a map

plotRGB

Red-Green-Blue plot of a multi-layered SpatRaster

prcomp

SpatRaster PCA with prcomp

predict

Spatial model predictions

princomp

SpatRaster PCA with princomp

project

Change the coordinate reference system

quantile

Quantiles of spatial data

query

Query a SpatVectorProxy object

rangeFill

Fill layers with a range

rapp

Range-apply

rast

Create a SpatRaster

rasterize

Rasterize vector data

rasterizeGeom

Rasterize geometric properties of vector data

rasterizeWin

Rasterize points with a moving window

rcl

Combine row, column, and layer numbers

readwrite

Read from, or write to, file

rectify

Rectify a SpatRaster

regress

Cell level regression

relate

Spatial relationships between geometries

rep

Replicate layers

replace_dollar

Replace with $<-

replace_layers

Replace layers or variables

replace_values

Replace values of a SpatRaster

resample

Transfer values of a SpatRaster to another one with a different geomet...

rescale

rescale

RGB

Layers representing colors

roll

Rolling (moving) functions

rotate

Rotate data along longitude

rowSums

row/col sums and means for SpatRaster

same.crs

Compare coordinate reference systems

sample

Take a regular sample

sapp

Apply a terra function that takes only a single layer and returns a Sp...

sbar

scale bar

scale_linear

Scale values linearly

scale

Scale values

scatter

Scatterplot of two SpatRaster layers

scoff

Scale (gain) and offset

sds

Create a SpatRasterDataset

segregate

segregate

select

Spatial selection

selectHigh

select cells with high or low values

selectRange

Select the values of a range of layers, as specified by cell values in...

serialize

saveRDS and serialize for SpatVector and SpatRaster*

setValues

Set the values of raster cells or of geometry attributes

shade

Hill shading

sharedPaths

Shared paths

shift

Shift

sieve

Sieve filter

simplify

simplifyGeom geometries

sort

Sort a SpatRaster or SpatVector

sources

Data sources of a SpatRaster

SpatExtent-class

Class "SpatExtent"

SpatRaster-class

SpatRaster class

SpatVector-class

Class "SpatVector"

spin

spin a SpatVector

split

Split a SpatRaster or SpatVector

sprc

Create a SpatRasterCollection

stretch

Stretch

subset_dollar

Subset a SpatRaster or a SpatVector

subset_double

Subset a SpatRaster or a SpatVector

subset_single

Extract values from a SpatRaster, SpatVector or SpatExtent

subset

Subset a SpatRaster or a SpatVector

subst

replace cell values

summarize-generics

Summarize

summary

summary

surfArea

Compute surface area from elevation data

svc

Create a SpatVectorCollection

symdif

Symmetrical difference

tapp

Apply a function to subsets of layers of a SpatRaster

terra-package

Description of the methods in the terra package

terrain

terrain characteristics

terraOptions

Options

text

Add labels to a map

time

time of SpatRaster layers

tmpFile

Temporary files

toMemory

Read all cell values into memory

topology

Vector topology methods

transpose

Transpose

trim

Trim a SpatRaster

union

Union SpatVector or SpatExtent objects

unique

Unique values

units

units of SpatRaster or SpatRasterDataSet

update

Change values in a file

values

Cell values and geometry attributes

varnames

variable and long variable names

vect

Create SpatVector objects

vector_layers

List or remove layers from a vector file

viewshed

Compute a viewshed

voronoi

Voronoi diagram and Delaunay triangles

vrt_tiles

filenames of VRT tiles

vrt

Virtual Raster Dataset

watershed

Catchment delineation

weighted.mean

Weighted mean of layers

where

Where are the cells with the min or max values?

which

Which cells are TRUE?

width

SpatVector geometric properties

window

Set a window

wrap

wrap and unwrap

wrapCache

SpatRaster wrap with caching options

writeCDF

Write raster data to a NetCDF file

writeRaster

Write raster data to a file

writeVector

Write SpatVector data to a file

xapp

Apply a function to the cells of a two SpatRasters

xmin

Get or set single values of an extent

xyCellFrom

Coordinates from a row, column or cell number and vice versa

zonal

Zonal statistics

zoom

Zoom in on a map

Methods for spatial data analysis with vector (points, lines, polygons) and raster (grid) data. Methods for vector data include geometric operations such as intersect and buffer. Raster methods include local, focal, global, zonal and geometric operations. The predict and interpolate methods facilitate the use of regression type (interpolation, machine learning) models for spatial prediction, including with satellite remote sensing data. Processing of very large files is supported. See the manual and tutorials on <https://rspatial.org/> to get started. 'terra' replaces the 'raster' package ('terra' can do more, and it is faster and easier to use).

  • Maintainer: Robert J. Hijmans
  • License: GPL (>= 3)
  • Last published: 2025-01-14