Learn R Programming

raster (version 3.6-32)

Geographic Data Analysis and Modeling

Description

Reading, writing, manipulating, analyzing and modeling of spatial data. This package has been superseded by the "terra" package .

Copy Link

Version

Install

install.packages('raster')

Monthly Downloads

138,294

Version

3.6-32

License

GPL (>= 3)

Maintainer

Robert Hijmans

Last Published

March 28th, 2025

Functions in raster (3.6-32)

approxNA

Estimate values for cell values that are NA by interpolating between layers
adjacent

Adjacent cells
addLayer

Add or drop a layer
as.character

Character representation of a Raster or Extent object
bands

Number of bands
animate

Animate layers of a Raster* object
aggregate

Aggregate raster cells or SpatialPolygons/Lines
atan2

Two argument arc-tangent
as.data.frame

Get a data.frame with raster cell values, or coerce SpatialPolygons, Lines, or Points to a data.frame
as.logical

Change cell values to logical or integer values
as.list

Create a list of RasterLayer objects
boundaries

boundaries (edges) detection
clamp

Clamp values
autocorrelation

Spatial autocorrelation
clearValues

Clear values
calc

Calculate
area

Size of cells
cellFrom

Get cell, row, or column number
click

Query by clicking on a map
blockSize

Block size for writing files
as.raster

Coerce to a 'raster' object
as.matrix

Get a vector, matrix, or array with raster cell values
barplot

Bar plot of a RasterLayer
compareRaster

Compare Raster objects
bind

Bind Spatial* objects
cut

Convert values to classes
buffer

buffer
brick

Create a RasterBrick object
corLocal

Local correlation coefficient
compareCRS

Partially compare two CRS objects
cover

Replace NA values with values of other layers
direction

Direction
cv

Coefficient of variation
cellStats

Statistics across cells
extension

Filename extensions
extent

Extent
clump

Detect clumps
filename

Filename
boxplot

Box plot of Raster objects
cellsFromExtent

Cells from extent, and vice versa
hdr

Header files
filledContour

Filled contour plot
crop

Crop
crosstab

Cross-tabulate
contour

Contour plot
head

Show the head or tail of a Raster* object
erase

disaggregate

Disaggregate
extract

Extract values from Raster objects
extend

Extend
dim

Dimensions of a Raster* object
density

Density plot
Extreme coordinates

Coordinates of the Extent of a Raster object
dataType

Data type
flip

Flip
cluster

Use a multi-core cluster
colortable

colortable
draw

Draw a line or polygon
Extract by index

Indexing to extract values of a Raster* object
intersect

Intersect
image

Image
isLonLat

Is this longitude/latitude data?
match

Value matching for Raster* objects
focal

Focal values
drawExtent

Create an Extent object by drawing on a map
merge

Merge Raster* objects
inifile

Read a .ini file
rasterToContour

Raster to contour lines conversion
rasterToPoints

Raster to points conversion
focalWeight

Focal weights matrix
getValues

Get raster cell values
freq

Frequency table
datasource

Are values in memory and/or on disk?
distance

Distance
sampleRandom

Random sample
SampleInt

Sample integer values
Gain and offset

Gain and offset of values on file
flowPath

Flow path
setExtent

Set the extent of a RasterLayer
getValuesFocal

Get focal raster cell values
hillShade

Hill shading
initialize

Initialize a Raster object with values
hist

Histogram
gridDistance

Distance on a grid
setMinMax

Compute min and max values
getValuesBlock

Get a block of raster cell values
plotRGB

Red-Green-Blue plot of a multi-layered Raster object
interpolate

Interpolate
metadata

Metadata
modal

modal value
pointDistance

Distance between points
names

Names of raster layers
Options

Global options for the raster package
rasterTmpFile

Temporary files
Summary

Summary
localFun

Local functions
symdif

Symetrical difference
unstack

Unstack
update

Update raster cells of files (on disk)
predict

Spatial model predictions
ncell

Number or rows, columns, and cells of a Raster* object
mask

Mask values in a Raster object
writeRaster

Write raster data to a file
writeValues

Write values to a file
Programming

Helper functions for programming
mosaic

Merge Raster* objects using a function for overlapping areas
projectRaster

Project a Raster object
properties

Raster file properties
rasterToPolygons

Raster to polygons conversion
movingFun

Moving functions
persp

Perspective plot
rasterize

Rasterize points, lines, or polygons
quantile

Raster quantiles
rectify

rectify a Raster object
stackSave

Save or open a RasterStack file
scale

Scale values
replacement

Replace cell values or layers of a Raster* object
substitute

Substitute values in a Raster* object
round

Integer values
distanceFromPoints

Distance from points
extremeValues

Minimum and maximum values
factors

Factors
Extent math

round Extent coordinates
subset

Subset layers in a Raster* object
plot

Plot a Raster* object
spEasy

Create SpatialLines* or SpatialPolygons*
geom

Get the coordinates of a vector type Spatial* object
resample

Resample a Raster object
getData

Get geographic data
projection

Get or set a coordinate reference system (projection)
layerStats

Correlation and (weighted) covariance
raster-package

Overview of the functions in the raster package
layerize

Layerize
raster

Create a RasterLayer object
rotate

Rotate
rotated

Do the raster cells have a rotation?
rowFromCell

Row or column number from a cell number
resolution

Resolution
spplot

Use spplot to plot a Raster* or other object
sampleRegular

Regular sample
rowSums

rowSums and colSums for Raster objects
nlayers

Number of layers
stackSelect

Select cell values from a multi-layer Raster* object
setValues

Set values of a Raster object
shapefile

Read or write a shapefile
sampleStratified

Stratified random sample
stack

Create a RasterStack object
shift

Shift
origin

Origin
Slope and aspect

Slope and aspect
terrain

Terrain characteristics
stackApply

Apply a function on subsets of a RasterStack or RasterBrick
text

Add labels to a map
transpose

Transpose
trim

Trim
stretch

Stretch
union

Union Extent or SpatialPolygons* objects
unique

Unique values
overlay

Overlay Raster objects
weighted.mean

Weighted mean of rasters
which

Which cells are TRUE?
pairs

Pairs plot (matrix of scatterplots)
rasterFromCells

Subset a raster by cell numbers
which.min

Where is the min or max value?
zonal

Zonal statistics
writeFormats

File types for writing
rasterFromXYZ

Create a Raster* object from x, y, z values
z-values

Get or set z-values
zoom

Zoom in on a map
readAll

Read values from disk
reclassify

Reclassify
scalebar

scalebar
select

Geometric subsetting
validCell

Validity of a cell, column or row number
validNames

Create valid names
xyFromCell

Coordinates from a row, column or cell number
zApply

z (time) apply
Raster-class

Raster* classes
NAvalue

Set the NA value of a RasterLayer
KML

Write a KML or KMZ file
RGB

Create a Red-Green-Blue Raster object
Math-methods

Mathematical functions
Arith-methods

Arithmetic with Raster* objects
Extent-class

Class "Extent"
Compare-methods

Compare Raster* objects
Rcpp-class

Rcpp classes
Logic-methods

Logical operators and functions
alignExtent

Align an extent (object of class Extent)
Summary-methods

Summary methods