Learn R Programming

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

terra (version 1.2-5)

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-5

License

GPL (>= 3)

Maintainer

Last Published

April 30th, 2021

Functions in terra (1.2-5)

copy

Deep copy
clamp

Clamp values
adjacent

Adjacent cells
barplot

Bar plot of a SpatRaster
aggregate

Aggregate raster or vector data
disaggregate

Disaggregate raster cells
convexhull

Convex hull
names

Names of Spat* objects
focalMat

Focal weights matrix
cover

Replace values with values from another object
intersect

Intersection
boundaries

Detect boundaries (edges)
distance

Geographic distance
geomtype

Geometry type of a SpatVector
focalValues

Get focal values
geom

Get the geometry (coordinates) of a SpatVector
classify

Classify (or reclassify) cell values
is.lonlat

Check for longitude/latitude crs
expand

Extend
as.character

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

Density plot
mosaic

mosaic SpatRasters
resample

Transfer values of a SpatRaster to another one with a different geometry
head and tail

Show the head or tail of a Spat* object
as.data.frame

SpatRaster or SpatVector to data.frame
SpatVector-class

Class "SpatVector"
sel

Spatial selection
sds

Create a SpatRasterDataset
as.raster

Coerce to a "raster" object
subset-vector

Subset of a SpatVector
SpatRaster-class

SpatRaster class
rapp

Range-Apply
add

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

replace cell values
time

time of SpatRaster layers
subset

Subset of a SpatRaster
tmpFiles

Temporary files
vrt

Virtual Raster Tiles
weighted.mean

Weighted mean of layers
which.lyr

Which cells are TRUE?
wrap

pack a SpatRaster or SpatVector object
as.spatvector

Coercion to a SpatVector, or to another SpatVector type
crosstab

Cross-tabulate
click

Query by clicking on a map
summarize-generics

Summarize
crop

Cut out a geographic subset
factors

Factors
NAflag

Set the NA flag
xyRowColCell

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

Zonal statistics
autocorrelation

Spatial autocorrelation
global

global statistics
origin

Origin
mask

Mask values in a SpatRaster
SpatExtent-class

Class "SpatExtent"
pairs

Pairs plot (matrix of scatterplots)
fillHoles

Remove holes from polygons
dimensions

Dimensions of a SpatRaster or SpatVector and related objects
area

Area and perimeter
symdif

Symetrical difference
rasterize

Rasterize vector data
boxplot

Box plot of SpatRaster data
cells

Get cell numbers
summary

summary
rescale

rescale
sapp

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

Write raster data to a NetCDF file
quantile

SpatRaster local quantiles
crs

Get or set a coordinate reference system
buffer

Create a buffer around vector objects or raster patches
compareGeom

Compare geometries of SpatRasters
colors

Color table
freq

Frequency table
image

SpatRaster image method
draw

Draw a polygon, line, extent, or points
ext

Create, get or set a SpatExtent
extract

Extract values from a SpatRaster
dots

Make a dot-density map
initialize

Initialize a SpatRaster with values
transpose

Transpose
nearest

nearby geometries
depth

depth of SpatRaster layers
setValues

Set the values of raster cells or of geometry attributes
sbar

scalebar
window

Set a window
writeRaster

Write raster data to a file
RGB

Declare RGB channels
linearUnits

Linear units of the coordinate reference system
focal

Focal values
hist

Histogram
describe

describe
unique

Unique values
inset

Make an inset map
sources

Data sources of a SpatRaster
align

Align a SpatExtent
interpolate

Interpolate
coerce

Coercion of a SpatRaster to other object types
atan2

Two argument arc-tangent
is.valid

Check polygon validity
app

Apply a function to the cells of a SpatRaster
rep

Replicate layers
cartogram

Cartogram
lapp

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

Combine SpatRaster or SpatVector objects
trim

Trim a SpatRaster
rast

Create a SpatRaster
read and write

Read from, or write to, file
tighten

tighten SpatRaster or SpatRasterDataset objects
spin

spin a SpatVector
plot

Make a map
erase

Erase parts of a SpatVector object
animate

Animate a SpatRaster
relate

relate
diff

diff
extremes

Get or compute the minimum and maximum cell values
vector-attributes

Get or replace attribute values of a SpatVector
spatSample

Take a regular sample
ifel

ifelse for SpatRasters
replace

Replace values of a SpatRaster
coords

Get the coordinates of SpatVector geometries or SpatRaster cells
centroids

Get centroids
modal

modal value
contour

Contour plot
stretch

Stretch
lines

Add SpatVector data to a map
shift

Shift
flip

Flip or reverse a raster
plotRGB

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

Scale values
writeVector

Write SpatVector data to a file
tapp

Apply a function to subsets of layers of a SpatRaster
text

Add labels to a map
tiles

Make tiles
persp

Perspective plot
merge

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

Arithmetic, logical and general mathematical methods
rectify

rectify a SpatRaster
scatterplot

Scatterplot of two SpatRaster layers
patches

Detect patches (clumps) of cells
vect

Create SpatVector objects
rotate

Rotate a SpatRaster along longitude
gdal

gdal utilities
predict

Spatial model predictions
voronoi

voronoi diagram and delauny triangles
match

Value matching for SpatRasters
svc

Create a SpatVectorCollection
terra-package

The terra package
zoom

Zoom in on a map
union

Union SpatVector or SpatExtent objects
terrain

terrain characteristic
project

Change the coordinate reference system
selectRange

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

Get or set single values of an extent
separate

separate
units

units of SpatRaster or SpatRasterDataSet
options

Options
values

Cell values and geometry attributes