Learn R Programming

⚠️There's a newer version (1.7-83) of this package.Take me there.

terra (version 1.3-22)

Spatial Data Analysis

Description

Methods for spatial data analysis with raster and vector data. Raster methods allow for low-level data manipulation as well as high-level global, local, zonal, and focal computation. 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 to get started. 'terra' is very similar to the 'raster' package; but 'terra' can do more, is easier to use, and it is faster.

Copy Link

Version

Install

install.packages('terra')

Monthly Downloads

183,196

Version

1.3-22

License

GPL (>= 3)

Maintainer

Last Published

August 20th, 2021

Functions in terra (1.3-22)

align

Align a SpatExtent
RGB

Declare RGB channels
activeCat

Active category
aggregate

Aggregate raster or vector data
SpatRaster-class

SpatRaster class
add

Add (in place) a SpatRaster to another SpatRaster object
NAflag

Set the NA flag
SpatVector-class

Class "SpatVector"
SpatExtent-class

Class "SpatExtent"
adjacent

Adjacent cells
as.raster

Coerce to a "raster" object
boundaries

Detect boundaries (edges)
animate

Animate a SpatRaster
barplot

Bar plot of a SpatRaster
app

Apply a function to the cells of a SpatRaster
c

Combine SpatRaster or SpatVector objects
atan2

Two argument arc-tangent
clamp

Clamp values
autocorrelation

Spatial autocorrelation
classify

Classify (or reclassify) cell values
as.spatvector

Conversion to a SpatVector, or to another SpatVector type
catalyze

Factors to numeric
cartogram

Cartogram
compareGeom

Compare geometries of SpatRasters
as.character

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

Query by clicking on a map
tighten

tighten SpatRaster or SpatRasterDataset objects
cellSize

Area covered by each raster cell
depth

depth of SpatRaster layers
contour

Contour plot
coerce

Coercion of a SpatRaster to other object types
crop

Cut out a geographic subset
centroids

Get centroids
cells

Get cell numbers
describe

describe
buffer

Create a buffer around vector objects or raster patches
boxplot

Box plot of SpatRaster data
convHull

Convex hull and minimal rotated rectangle
fillHoles

Remove holes from polygons
focalValues

Get focal values
distance

Geographic distance
crds

Get the coordinates of SpatVector geometries or SpatRaster cells
disaggregate

Disaggregate raster cells
ext

Create, get or set a SpatExtent
expand

Extend
density

Density plot
colors

Color table
crs

Get or set a coordinate reference system
erase

Erase parts of a SpatVector object
freq

Frequency table
extract

Extract values from a SpatRaster
crosstab

Cross-tabulate
factors

Categorical rasters
global

global statistics
initialize

Initialize a SpatRaster with values
flip

Flip or reverse a raster
Spatial interpolation

Interpolate
geomtype

Geometry type of a SpatVector
intersect

Intersection
expanse

Get the expanse (area) of individual polygons or for all (summed) raster cells
inset

Make an inset map
math

Arithmetic, logical and general mathematical methods
plot

Make a map
plotRGB

Red-Green-Blue plot of a multi-layered SpatRaster
read and write

Read from, or write to, file
copy

Deep copy
cover

Replace values with values from another object
as.data.frame

SpatRaster or SpatVector to data.frame
focalMat

Focal weights matrix
focal

Focal values
mask

Mask values in a SpatRaster
gdal

GDAL version and supported file formats
geom

Get the geometry (coordinates) of a SpatVector
ifel

ifelse for SpatRasters
match

Value matching for SpatRasters
rectify

rectify a SpatRaster
is.lonlat

Check for longitude/latitude crs
rotate

Rotate a SpatRaster along longitude
modal

modal value
image

SpatRaster image method
mem

Memory available and needed
shade

Hill shading
spatSample

Take a regular sample
setValues

Set the values of raster cells or of geometry attributes
is.valid

Check polygon validity
rast

Create a SpatRaster
mosaic

mosaic SpatRasters
na.omit

na.omit for SpatVector
rasterize

Rasterize vector data
names

Names of Spat* objects
resample

Transfer values of a SpatRaster to another one with a different geometry
nearest

nearby geometries
origin

Origin
relate

relate
diff

Lagged differences
lines

Add SpatVector data to a map
dimensions

Dimensions of a SpatRaster or SpatVector and related objects
rescale

rescale
draw

Draw a polygon, line, extent, or points
dots

Make a dot-density map
makeTiles

Make tiles
pairs

Pairs plot (matrix of scatterplots)
union

Union SpatVector or SpatExtent objects
trim

Trim a SpatRaster
stretch

Stretch
src

Create a SpatRasterCollection
head and tail

Show the head or tail of a Spat* object
wrap

wrap (pack) a SpatRaster or SpatVector object
window

Set a window
summary

summary
time

time of SpatRaster layers
tmpFiles

Temporary files
unique

Unique values
svc

Create a SpatVectorCollection
lapp

Apply a function to layers of a SpatRaster, or sub-datasets of a SpatRasterDataset
units

units of SpatRaster or SpatRasterDataSet
linearUnits

Linear units of the coordinate reference system
predict

Spatial model predictions
hist

Histogram
rep

Replicate layers
sds

Create a SpatRasterDataset
patches

Detect patches (clumps) of cells
writeCDF

Write raster data to a NetCDF file
writeRaster

Write raster data to a file
rapp

Range-Apply
quantile

Quantiles of spatial data
segregate

segregate
transpose

Transpose
xmin

Get or set single values of an extent
writeVector

Write SpatVector data to a file
tapp

Apply a function to subsets of layers of a SpatRaster
symdif

Symetrical difference
topology

sharedPaths
extremes

Get or compute the minimum and maximum cell values
merge

Merge SpatRaster or SpatExtent objects, or a SpatVector with a data.frame
project

Change the coordinate reference system
perim

Perimeter or length
sbar

scalebar
persp

Perspective plot
shift

Shift
subset-vector

Subset of a SpatVector
vector-attributes

Get or replace attribute values of a SpatVector
subset

Subset of a SpatRaster
sources

Data sources of a SpatRaster
sapp

Apply a terra function that takes only a single layer to all layers
spin

spin a SpatVector
scale

Scale values
scatterplot

Scatterplot of two SpatRaster layers
replace

Replace values of a SpatRaster
split

Split
vrt

Virtual Raster Tiles
voronoi

Voronoi diagram and Delauny triangles
terrain

terrain characteristic
sel

Spatial selection
subst

replace cell values
summarize-generics

Summarize
which.lyr

Which cells are TRUE?
terra-package

The terra package
options

Options
weighted.mean

Weighted mean of layers
selectRange

Select the values of a range of layers, as specified by cell values in another SpatRaster
xyRowColCell

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

Create SpatVector objects
text

Add labels to a map
values

Cell values and geometry attributes
zonal

Zonal statistics
zoom

Zoom in on a map