Learn R Programming

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

terra (version 1.4-9)

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

229,584

Version

1.4-9

License

GPL (>= 3)

Maintainer

Robert Hijmans

Last Published

October 7th, 2021

Functions in terra (1.4-9)

adjacent

Adjacent cells
RGB

Declare RGB channels
NAflag

Set the NA flag
add

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

Active category
SpatVector-class

Class "SpatVector"
SpatExtent-class

Class "SpatExtent"
SpatRaster-class

SpatRaster class
aggregate

Aggregate raster or vector data
align

Align a SpatExtent
as.character

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

Apply a function to the cells of a SpatRaster
animate

Animate a SpatRaster
as.raster

Coerce to a "raster" object
boxplot

Box plot of SpatRaster data
buffer

Create a buffer around vector objects or raster patches
as.spatvector

Conversion to a SpatVector, or to another SpatVector type
cells

Get cell numbers
autocorrelation

Spatial autocorrelation
catalyze

Factors to numeric
cellSize

Area covered by each raster cell
atan2

Two argument arc-tangent
barplot

Bar plot of a SpatRaster
as.data.frame

SpatRaster or SpatVector to data.frame
tighten

tighten SpatRaster or SpatRasterDataset objects
boundaries

Detect boundaries (edges)
copy

Deep copy
classify

Classify (or reclassify) cell values
clamp

Clamp values
centroids

Get centroids
click

Query by clicking on a map
distance

Geographic distance
disagg

Disaggregate raster cells or vector geometries
cover

Replace values with values from another object
coerce

Coercion of a SpatRaster to other object types
colors

Color table
dimensions

Dimensions of a SpatRaster or SpatVector and related objects
draw

Draw a polygon, line, extent, or points
crop

Cut out a geographic subset
diff

Lagged differences
dots

Make a dot-density map
erase

Erase parts of a SpatVector object
c

Combine SpatRaster or SpatVector objects
crosstab

Cross-tabulate
expanse

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

Get the geometry (coordinates) of a SpatVector
gdal

GDAL version and supported file formats
focal

Focal values
focalMat

Focal weights matrix
factors

Categorical rasters
extract

Extract values from a SpatRaster
contour

Contour plot
is.valid

Check polygon validity
crs

Get or set a coordinate reference system
cartogram

Cartogram
compareGeom

Compare geometries of SpatRasters
is.lonlat

Check for longitude/latitude crs
lapp

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

Linear units of the coordinate reference system
crds

Get the coordinates of SpatVector geometries or SpatRaster cells
depth

depth of SpatRaster layers
convHull

Convex hull and minimal rotated rectangle
ext

Create, get or set a SpatExtent
Spatial interpolation

Interpolate
intersect

Intersection
hist

Histogram
density

Density plot
head and tail

Show the head or tail of a Spat* object
nearest

nearby geometries
expand

Extend
mosaic

mosaic SpatRasters
focalValues

Get focal values
modal

modal value
freq

Frequency table
describe

describe
mask

Mask values in a SpatRaster
image

SpatRaster image method
ifel

ifelse for SpatRasters
extremes

Get or compute the minimum and maximum cell values
math

Arithmetic, logical and general mathematical methods
merge

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

Memory available and needed
quantile

Quantiles of spatial data
match

Value matching for SpatRasters
persp

Perspective plot
perim

Perimeter or length
resample

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

Names of Spat* objects
na.omit

na.omit for SpatVector
fillHoles

Remove holes from polygons
sel

Spatial selection
pairs

Pairs plot (matrix of scatterplots)
origin

Origin
rectify

rectify a SpatRaster
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
rasterize

Rasterize vector data
rast

Create a SpatRaster
patches

Detect patches (clumps) of cells
vector-attributes

Get or replace attribute values of a SpatVector
replace

Replace values of a SpatRaster
initialize

Initialize a SpatRaster with values
flip

Flip or reverse a raster
geomtype

Geometry type of a SpatVector
sds

Create a SpatRasterDataset
global

global statistics
lines

Add SpatVector data to a map
inset

Make an inset map
stretch

Stretch
segregate

segregate
rescale

rescale
src

Create a SpatRasterCollection
predict

Spatial model predictions
rotate

Rotate a SpatRaster along longitude
spatSample

Take a regular sample
spin

spin a SpatVector
rapp

Range-Apply
trim

Trim a SpatRaster
project

Change the coordinate reference system
union

Union SpatVector or SpatExtent objects
terrain

terrain characteristic
symdif

Symetrical difference
tapp

Apply a function to subsets of layers of a SpatRaster
window

Set a window
wrap

wrap (pack) a SpatRaster or SpatVector object
plot

Make a map
options

Options
terra-package

The terra package
makeTiles

Make tiles
split

Split
summary

summary
plotRGB

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

Replicate layers
sbar

scalebar
relate

relate
sapp

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

Scale values
scatterplot

Scatterplot of two SpatRaster layers
topology

sharedPaths
setValues

Set the values of raster cells or of geometry attributes
shade

Hill shading
subst

replace cell values
svc

Create a SpatVectorCollection
shift

Shift
time

time of SpatRaster layers
transpose

Transpose
subset

Subset of a SpatRaster
sources

Data sources of a SpatRaster
summarize

Summarize
subset-vector

Subset of a SpatVector
unique

Unique values
tmpFiles

Temporary files
values

Cell values and geometry attributes
xmin

Get or set single values of an extent
voronoi

Voronoi diagram and Delauny triangles
text

Add labels to a map
writeVector

Write SpatVector data to a file
vrt

Virtual Raster Tiles
vect

Create SpatVector objects
writeCDF

Write raster data to a NetCDF file
zoom

Zoom in on a map
units

units of SpatRaster or SpatRasterDataSet
weighted.mean

Weighted mean of layers
writeRaster

Write raster data to a file
xyRowColCell

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

Which cells are TRUE?
zonal

Zonal statistics