Learn R Programming

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

terra (version 1.1-17)

Spatial Data Analysis

Description

Methods for spatial data analysis, especially raster data. 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. 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 and it simpler to use and it is faster.

Copy Link

Version

Install

install.packages('terra')

Monthly Downloads

183,196

Version

1.1-17

License

GPL (>= 3)

Maintainer

Last Published

April 14th, 2021

Functions in terra (1.1-17)

SpatVector-class

Class "SpatVector"
adjacent

Adjacent cells
SpatRaster-class

SpatRaster class
SpatExtent-class

Class "SpatExtent"
animate

Animate a SpatRaster
align

Align a SpatExtent
add

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

Declare RGB channels
NAflag

Set a value to NA
as.raster

Coerce to a "raster" object
aggregate

Aggregate raster or vector data
area

Area and perimeter
app

Apply a function to the cells of a SpatRaster
buffer

Create a buffer around vector objects or raster patches
boxplot

Box plot of SpatRaster data
copy

Deep copy
cover

Replace values with values from another object
autocorrelation

Spatial autocorrelation
centroids

Get centroids
cells

Get cell numbers
atan2

Two argument arc-tangent
crop

Cut out a geographic subset
dimensions

Dimensions of a SpatRaster or SpatVector and related objects
crosstab

Cross-tabulate
as.character

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

diff
as.data.frame

SpatRaster or SpatVector to data.frame
crs

Get or set a coordinate reference system
density

Density plot
ext

Create, get or set a SpatExtent
extract

Extract values from a SpatRaster
classify

Classify (or reclassify) cell values
boundaries

Detect boundaries (edges)
barplot

Bar plot of a SpatRaster
mask

Mask values in a SpatRaster
match

Value matching for SpatRasters
c

Combine SpatRaster or SpatVector objects
as.spatvector

Coercion to a SpatVector, or to another SpatVector type
draw

Draw a polygon, line, extent, or points
geom

Get the geometry (coordinates) of a SpatVector
erase

Erase parts of a SpatVector object
dots

Make a dot-density map
expand

Expand
click

Query by clicking on a map
cartogram

Cartogram
coerce

Coercion of a SpatRaster to other object types
geomtype

Geometry type of a SpatVector
pack

pack a SpatRaster or SpatVector object
clamp

Clamp values
colors

Color table
convexhull

Convex hull
compareGeom

Compare geometries of SpatRasters
focal

Focal values
flip

Flip or reverse a raster
is.lonlat

Check for longitude/latitude crs
intersect

Intersection
head and tail

Show the head or tail of a Spat* object
global

global statistics
patches

Detect patches (clumps) of cells
extremes

Get or compute the minimum and maximum cell values
project

Change the coordinate reference system
persp

Perspective plot
predict

Spatial model predictions
modal

modal value
rep

Replicate layers
collapse

Collapse SpatRaster or SpatRasterDataset objects
disaggregate

Disaggregate raster cells
relate

relate
pairs

Pairs plot (matrix of scatterplots)
distance

Geographic distance
gdal

gdal utilities
freq

Frequency table
inset

Make an inset map
resample

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

Factors
scale

Scale values
sbar

scalebar
symdif

Symetrical difference
initialize

Initialize a SpatRaster with values
linearUnits

Linear units of the coordinate reference system
interpolate

Interpolate
image

SpatRaster image method
fill

Remove holes from polygons
lines

Add SpatVector data to a map
rescale

rescale
names

Names of Spat* objects
mosaic

mosaic SpatRasters
math

Arithmetic, logical and general mathematical methods
plotRGB

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

Make a map
voronoi

voronoi diagram and delauny triangles
time

time of SpatRaster layers
merge

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

Apply a function to subsets of layers of a SpatRaster
tiles

Make tiles
vrt

Virtual Raster Tiles
replace

Replace values of a SpatRaster
coords

Get the coordinates of SpatVector geometries or SpatRaster cells
shift

Shift
vector-attributes

Get or replace attribute values of a SpatVector
depth

depth of SpatRaster layers
setValues

Set the values of raster cells or of geometry attributes
contour

Contour plot
separate

separate
subset-vector

Subset of a SpatVector
sources

Data sources of a SpatRaster
subset

Subset of a SpatRaster
tmpFiles

Temporary files
quantile

SpatRaster local quantiles
rapp

Range-Apply
focalMat

Focal weights matrix
rectify

rectify a SpatRaster
spin

spin a SpatVector
read and write

Read from, or write to, file
describe

describe
transpose

Transpose
trim

Trim a SpatRaster
stretch

Stretch
union

Union SpatVector or SpatExtent objects
values

Cell values and geometry attributes
ifel

ifelse for SpatRasters
is.valid

Check polygon validity
lapp

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

Histogram
focalValues

Get focal values
vect

Create SpatVector objects
subst

replace cell values
summarize-generics

Summarize
window

Set a window
writeCDF

Write raster data to a NetCDF file
writeRaster

Write raster data to a file
terra-package

The terra package
nearest

nearby geometries
origin

Origin
scatterplot

Scatterplot of two SpatRaster layers
rast

Create a SpatRaster
options

Options
writeVector

Write SpatVector data to a file
rotate

Rotate a SpatRaster along longitude
weighted.mean

Weighted mean of layers
select

Spatial selection
selectRange

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

Create a SpatRasterDataset
summary

summary
rasterize

Rasterize vector data
spatSample

Take a regular sample
svc

Create a SpatVectorCollection
terrain

terrain characteristic
which.lyr

Which cells are TRUE?
xyRowColCell

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

Get or set single values of an extent
unique

Unique values
units

units of SpatRaster or SpatRasterDataSet
text

Add labels to a map
zonal

Zonal statistics
zoom

Zoom in on a map