Learn R Programming

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

terra (version 1.4-7)

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.4-7

License

GPL (>= 3)

Maintainer

Last Published

October 5th, 2021

Functions in terra (1.4-7)

SpatVector-class

Class "SpatVector"
activeCat

Active category
add

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

Animate a SpatRaster
adjacent

Adjacent cells
align

Align a SpatExtent
aggregate

Aggregate raster or vector data
app

Apply a function to the cells of a SpatRaster
atan2

Two argument arc-tangent
catalyze

Factors to numeric
copy

Deep copy
cells

Get cell numbers
centroids

Get centroids
cellSize

Area covered by each raster cell
cover

Replace values with values from another object
boundaries

Detect boundaries (edges)
clamp

Clamp values
barplot

Bar plot of a SpatRaster
NAflag

Set the NA flag
as.data.frame

SpatRaster or SpatVector to data.frame
disaggregate

Disaggregate raster cells
RGB

Declare RGB channels
as.character

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

Spatial autocorrelation
distance

Geographic distance
dots

Make a dot-density map
buffer

Create a buffer around vector objects or raster patches
boxplot

Box plot of SpatRaster data
tighten

tighten SpatRaster or SpatRasterDataset objects
draw

Draw a polygon, line, extent, or points
dimensions

Dimensions of a SpatRaster or SpatVector and related objects
head and tail

Show the head or tail of a Spat* object
ext

Create, get or set a SpatExtent
colors

Color table
diff

Lagged differences
expand

Extend
classify

Classify (or reclassify) cell values
crds

Get the coordinates of SpatVector geometries or SpatRaster cells
convHull

Convex hull and minimal rotated rectangle
global

global statistics
geomtype

Geometry type of a SpatVector
SpatRaster-class

SpatRaster class
c

Combine SpatRaster or SpatVector objects
lapp

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

Class "SpatExtent"
as.raster

Coerce to a "raster" object
compareGeom

Compare geometries of SpatRasters
as.spatvector

Conversion to a SpatVector, or to another SpatVector type
crop

Cut out a geographic subset
contour

Contour plot
cartogram

Cartogram
click

Query by clicking on a map
crs

Get or set a coordinate reference system
coerce

Coercion of a SpatRaster to other object types
fillHoles

Remove holes from polygons
crosstab

Cross-tabulate
flip

Flip or reverse a raster
gdal

GDAL version and supported file formats
focal

Focal values
Spatial interpolation

Interpolate
geom

Get the geometry (coordinates) of a SpatVector
intersect

Intersection
focalMat

Focal weights matrix
mask

Mask values in a SpatRaster
match

Value matching for SpatRasters
linearUnits

Linear units of the coordinate reference system
pairs

Pairs plot (matrix of scatterplots)
depth

depth of SpatRaster layers
describe

describe
initialize

Initialize a SpatRaster with values
extract

Extract values from a SpatRaster
inset

Make an inset map
factors

Categorical rasters
hist

Histogram
focalValues

Get focal values
is.valid

Check polygon validity
is.lonlat

Check for longitude/latitude crs
density

Density plot
expanse

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

Add SpatVector data to a map
erase

Erase parts of a SpatVector object
patches

Detect patches (clumps) of cells
modal

modal value
vector-attributes

Get or replace attribute values of a SpatVector
quantile

Quantiles of spatial data
rapp

Range-Apply
mosaic

mosaic SpatRasters
replace

Replace values of a SpatRaster
sel

Spatial selection
merge

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

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

relate
na.omit

na.omit for SpatVector
names

Names of Spat* objects
plot

Make a map
perim

Perimeter or length
scale

Scale values
image

SpatRaster image method
ifel

ifelse for SpatRasters
freq

Frequency table
extremes

Get or compute the minimum and maximum cell values
rep

Replicate layers
read and write

Read from, or write to, file
selectRange

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

Create a SpatRasterCollection
subset

Subset of a SpatRaster
rectify

rectify a SpatRaster
persp

Perspective plot
scatterplot

Scatterplot of two SpatRaster layers
subset-vector

Subset of a SpatVector
sbar

scalebar
setValues

Set the values of raster cells or of geometry attributes
math

Arithmetic, logical and general mathematical methods
sapp

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

Make tiles
predict

Spatial model predictions
transpose

Transpose
segregate

segregate
sds

Create a SpatRasterDataset
weighted.mean

Weighted mean of layers
vect

Create SpatVector objects
terrain

terrain characteristic
topology

sharedPaths
values

Cell values and geometry attributes
text

Add labels to a map
time

time of SpatRaster layers
project

Change the coordinate reference system
tmpFiles

Temporary files
stretch

Stretch
rescale

rescale
spin

spin a SpatVector
resample

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

replace cell values
split

Split
mem

Memory available and needed
shade

Hill shading
writeVector

Write SpatVector data to a file
which.lyr

Which cells are TRUE?
nearest

nearby geometries
symdif

Symetrical difference
summarize

Summarize
zoom

Zoom in on a map
options

Options
terra-package

The terra package
rasterize

Rasterize vector data
rotate

Rotate a SpatRaster along longitude
origin

Origin
voronoi

Voronoi diagram and Delauny triangles
rast

Create a SpatRaster
tapp

Apply a function to subsets of layers of a SpatRaster
shift

Shift
vrt

Virtual Raster Tiles
unique

Unique values
spatSample

Take a regular sample
sources

Data sources of a SpatRaster
summary

summary
svc

Create a SpatVectorCollection
trim

Trim a SpatRaster
union

Union SpatVector or SpatExtent objects
zonal

Zonal statistics
xyRowColCell

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

Set a window
writeRaster

Write raster data to a file
writeCDF

Write raster data to a NetCDF file
units

units of SpatRaster or SpatRasterDataSet
xmin

Get or set single values of an extent
wrap

wrap (pack) a SpatRaster or SpatVector object