Learn R Programming

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

raster (version 3.5-11)

Geographic Data Analysis and Modeling

Description

Reading, writing, manipulating, analyzing and modeling of spatial data. The package implements basic and high-level functions for raster data and for vector data operations such as intersections. See the manual and tutorials on to get started.

Copy Link

Version

Install

install.packages('raster')

Monthly Downloads

171,298

Version

3.5-11

License

GPL (>= 3)

Maintainer

Robert Hijmans

Last Published

December 23rd, 2021

Functions in raster (3.5-11)

NAvalue

Set the NA value of a RasterLayer
Math-methods

Mathematical functions
RGB

Create a Red-Green-Blue Raster object
KML

Write a KML or KMZ file
Extent-class

Class "Extent"
Arith-methods

Arithmetic with Raster* objects
approxNA

Estimate values for cell values that are NA by interpolating between layers
Raster-class

Raster* classes
Logic-methods

Logical operators and functions
Compare-methods

Compare Raster* objects
Rcpp-class

Rcpp classes
aggregate

Aggregate raster cells or SpatialPolygons/Lines
adjacent

Adjacent cells
alignExtent

Align an extent (object of class Extent)
as.raster

Coerce to a 'raster' object
animate

Animate layers of a Raster* object
as.matrix

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

Number of bands
barplot

Bar plot of a RasterLayer
as.character

Character representation of a Raster or Extent object
as.data.frame

Get a data.frame with raster cell values, or coerce SpatialPolygons, Lines, or Points to a data.frame
Summary-methods

Summary methods
boundaries

boundaries (edges) detection
addLayer

Add or drop a layer
boxplot

Box plot of Raster objects
blockSize

Block size for writing files
brick

Create a RasterBrick object
bind

Bind Spatial* objects
buffer

buffer
as.logical

Change cell values to logical or integer values
as.list

Create a list of RasterLayer objects
calc

Calculate
cellFrom

Get cell, row, or column number
clamp

Clamp values
autocorrelation

Spatial autocorrelation
atan2

Two argument arc-tangent
cellsFromExtent

Cells from extent, and vice versa
area

Size of cells
cellStats

Statistics across cells
clearValues

Clear values
clump

Detect clumps
click

Query by clicking on a map
corLocal

Local correlation coefficient
direction

Direction
colortable

colortable
cluster

Use a multi-core cluster
cover

Replace NA values with values of other layers
compareRaster

Compare Raster objects
compareCRS

Partially compare two CRS objects
disaggregate

Disaggregate
Extreme coordinates

Coordinates of the Extent of a Raster object
contour

Contour plot
density

Density plot
dim

Dimensions of a Raster* object
drawExtent

Create an Extent object by drawing on a map
draw

Draw a line or polygon
distance

Distance
crop

Crop
crosstab

Cross-tabulate
distanceFromPoints

Distance from points
cut

Convert values to classes
extension

Filename extensions
cv

Coefficient of variation
extremeValues

Minimum and maximum values
flip

Flip
focalWeight

Focal weights matrix
focal

Focal values
Extract by index

Indexing to extract values of a Raster* object
extract

Extract values from Raster objects
extent

Extent
datasource

Are values in memory and/or on disk?
Gain and offset

Gain and offset of values on file
extend

Extend
dataType

Data type
hillShade

Hill shading
erase

hist

Histogram
freq

Frequency table
hdr

Header files
factors

Factors
getValuesFocal

Get focal raster cell values
head

Show the head or tail of a Raster* object
gridDistance

Distance on a grid
isLonLat

Is this longitude/latitude data?
intersect

Intersect
image

Image
inifile

Read a .ini file
mask

Mask values in a Raster object
metadata

Metadata
modal

modal value
layerStats

Correlation and (weighted) covariance
localFun

Local functions
layerize

Layerize
names

Names of raster layers
ncell

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

Merge Raster* objects using a function for overlapping areas
filename

Filename
flowPath

Flow path
filledContour

Filled contour plot
getValues

Get raster cell values
getData

Get geographic data
geom

Get the coordinates of a vector type Spatial* object
initialize

Initialize a Raster object with values
movingFun

Moving functions
getValuesBlock

Get a block of raster cell values
interpolate

Interpolate
origin

Origin
pairs

Pairs plot (matrix of scatterplots)
nlayers

Number of layers
overlay

Overlay Raster objects
plot

Plot a Raster* object
persp

Perspective plot
match

Value matching for Raster* objects
projectRaster

Project a Raster object
merge

Merge Raster* objects
Programming

Helper functions for programming
predict

Spatial model predictions
projection

Get or set a coordinate reference system (projection)
plotRGB

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

Subset a raster by cell numbers
rasterTmpFile

Temporary files
raster-package

Overview of the functions in the raster package
quantile

Raster quantiles
pointDistance

Distance between points
Options

Global options for the raster package
properties

Raster file properties
rasterFromXYZ

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

Raster to contour lines conversion
raster

Create a RasterLayer object
resolution

Resolution
resample

Resample a Raster object
rasterToPolygons

Raster to polygons conversion
reclassify

Reclassify
rasterize

Rasterize points, lines, or polygons
readAll

Read values from disk
rotated

Do the raster cells have a rotation?
rotate

Rotate
rasterToPoints

Raster to points conversion
rowFromCell

Row or column number from a cell number
rowSums

rowSums and colSums for Raster objects
rectify

rectify a Raster object
replacement

Replace cell values or layers of a Raster* object
stackSave

Save or open a RasterStack file
scale

Scale values
sampleRegular

Regular sample
SampleInt

Sample integer values
sampleStratified

Stratified random sample
spplot

Use spplot to plot a Raster* or other object
setValues

Set values of a Raster object
spEasy

Create SpatialLines* or SpatialPolygons*
substitute

Substitute values in a Raster* object
subset

Subset layers in a Raster* object
Slope and aspect

Slope and aspect
shift

Shift
round

Integer values
writeValues

Write values to a file
writeRaster

Write raster data to a file
sampleRandom

Random sample
validNames

Create valid names
shapefile

Read or write a shapefile
validCell

Validity of a cell, column or row number
terrain

Terrain characteristics
Extent math

round Extent coordinates
stackApply

Apply a function on subsets of a RasterStack or RasterBrick
xyFromCell

Coordinates from a row, column or cell number
stack

Create a RasterStack object
text

Add labels to a map
zApply

z (time) apply
setExtent

Set the extent of a RasterLayer
unstack

Unstack
update

Update raster cells of files (on disk)
setMinMax

Compute min and max values
symdif

Symetrical difference
Summary

Summary
transpose

Transpose
which

Which cells are TRUE?
weighted.mean

Weighted mean of rasters
scalebar

scalebar
trim

Trim
select

Geometric subsetting
stackSelect

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

Zonal statistics
stretch

Stretch
z-values

Get or set z-values
zoom

Zoom in on a map
union

Union Extent or SpatialPolygons* objects
unique

Unique values
which.min

Where is the min or max value?
writeFormats

File types for writing