Learn R Programming

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

terra (version 1.2-10)

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 simpler to use, and it is faster.

Copy Link

Version

Install

install.packages('terra')

Monthly Downloads

183,196

Version

1.2-10

License

GPL (>= 3)

Maintainer

Last Published

May 13th, 2021

Functions in terra (1.2-10)

RGB

Declare RGB channels
add

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

Set the NA flag
SpatVector-class

Class "SpatVector"
aggregate

Aggregate raster or vector data
SpatExtent-class

Class "SpatExtent"
SpatRaster-class

SpatRaster class
adjacent

Adjacent cells
align

Align a SpatExtent
animate

Animate a SpatRaster
as.character

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

Detect boundaries (edges)
barplot

Bar plot of a SpatRaster
as.data.frame

SpatRaster or SpatVector to data.frame
c

Combine SpatRaster or SpatVector objects
cartogram

Cartogram
classify

Classify (or reclassify) cell values
crds

Get the coordinates of SpatVector geometries or SpatRaster cells
click

Query by clicking on a map
copy

Deep copy
convHull

Convex hull
contour

Contour plot
depth

depth of SpatRaster layers
as.spatvector

Conversion to a SpatVector, or to another SpatVector type
density

Density plot
as.raster

Coerce to a "raster" object
centroids

Get centroids
autocorrelation

Spatial autocorrelation
app

Apply a function to the cells of a SpatRaster
expanse

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

Two argument arc-tangent
crs

Get or set a coordinate reference system
crosstab

Cross-tabulate
cellSize

Area covered by each raster cell
extract

Extract values from a SpatRaster
ext

Create, get or set a SpatExtent
clamp

Clamp values
image

SpatRaster image method
factors

Factors
ifel

ifelse for SpatRasters
lapp

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

tighten SpatRaster or SpatRasterDataset objects
coerce

Coercion of a SpatRaster to other object types
linearUnits

Linear units of the coordinate reference system
cells

Get cell numbers
names

Names of Spat* objects
expand

Extend
global

global statistics
geomtype

Geometry type of a SpatVector
gdal

gdal utilities
boxplot

Box plot of SpatRaster data
describe

describe
mosaic

mosaic SpatRasters
plot

Make a map
diff

diff
flip

Flip or reverse a raster
fillHoles

Remove holes from polygons
plotRGB

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

Color table
buffer

Create a buffer around vector objects or raster patches
modal

modal value
perim

Perimeter or length
interpolate

Interpolate
extremes

Get or compute the minimum and maximum cell values
geom

Get the geometry (coordinates) of a SpatVector
vector-attributes

Get or replace attribute values of a SpatVector
cover

Replace values with values from another object
replace

Replace values of a SpatRaster
persp

Perspective plot
rasterize

Rasterize vector data
sel

Spatial selection
scale

Scale values
rast

Create a SpatRaster
selectRange

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

Scatterplot of two SpatRaster layers
head and tail

Show the head or tail of a Spat* object
hist

Histogram
lines

Add SpatVector data to a map
intersect

Intersection
split

Split
dimensions

Dimensions of a SpatRaster or SpatVector and related objects
draw

Draw a polygon, line, extent, or points
crop

Cut out a geographic subset
compareGeom

Compare geometries of SpatRasters
is.lonlat

Check for longitude/latitude crs
nearest

nearby geometries
is.valid

Check polygon validity
mask

Mask values in a SpatRaster
disaggregate

Disaggregate raster cells
erase

Erase parts of a SpatVector object
makeTiles

Make tiles
setValues

Set the values of raster cells or of geometry attributes
relate

relate
origin

Origin
rep

Replicate layers
pairs

Pairs plot (matrix of scatterplots)
rotate

Rotate a SpatRaster along longitude
spatSample

Take a regular sample
match

Value matching for SpatRasters
sources

Data sources of a SpatRaster
distance

Geographic distance
focal

Focal values
focalMat

Focal weights matrix
dots

Make a dot-density map
shift

Shift
freq

Frequency table
focalValues

Get focal values
patches

Detect patches (clumps) of cells
topology

sharedPaths
initialize

Initialize a SpatRaster with values
read and write

Read from, or write to, file
inset

Make an inset map
rectify

rectify a SpatRaster
spin

spin a SpatVector
terra-package

The terra package
math

Arithmetic, logical and general mathematical methods
sds

Create a SpatRasterDataset
stretch

Stretch
project

Change the coordinate reference system
transpose

Transpose
predict

Spatial model predictions
merge

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

terrain characteristic
segregate

segregate
rapp

Range-Apply
quantile

SpatRaster local quantiles
options

Options
resample

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

rescale
sbar

scalebar
subst

replace cell values
sapp

Apply a terra function that takes only a single layer to all layers
summarize-generics

Summarize
subset

Subset of a SpatRaster
subset-vector

Subset of a SpatVector
symdif

Symetrical difference
text

Add labels to a map
summary

summary
voronoi

voronoi diagram and delauny triangles
window

Set a window
vrt

Virtual Raster Tiles
weighted.mean

Weighted mean of layers
wrap

wrap (pack) a SpatRaster or SpatVector object
which.lyr

Which cells are TRUE?
svc

Create a SpatVectorCollection
tapp

Apply a function to subsets of layers of a SpatRaster
writeRaster

Write raster data to a file
writeCDF

Write raster data to a NetCDF file
trim

Trim a SpatRaster
values

Cell values and geometry attributes
xmin

Get or set single values of an extent
vect

Create SpatVector objects
writeVector

Write SpatVector data to a file
unique

Unique values
xyRowColCell

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

Temporary files
time

time of SpatRaster layers
union

Union SpatVector or SpatExtent objects
units

units of SpatRaster or SpatRasterDataSet
zonal

Zonal statistics
zoom

Zoom in on a map