Learn R Programming

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

raster (version 3.4-10)

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

153,616

Version

3.4-10

License

GPL (>= 3)

Maintainer

Robert Hijmans

Last Published

May 3rd, 2021

Functions in raster (3.4-10)

Compare-methods

Compare Raster* objects
Math-methods

Mathematical functions
Arith-methods

Arithmetic with Raster* objects
Rcpp-class

Rcpp classes
NAvalue

Set the NA value of a RasterLayer
Logic-methods

Logical operators and functions
Raster-class

Raster* classes
Extent-class

Class "Extent"
KML

Write a KML or KMZ file
approxNA

Estimate values for cell values that are NA by interpolating between layers
Summary-methods

Summary methods
RGB

Create a Red-Green-Blue Raster object
area

Size of cells
as.matrix

Get a vector, matrix, or array with raster cell values
as.raster

Coerce to a 'raster' object
adjacent

Adjacent cells
aggregate

Aggregate raster cells or SpatialPolygons/Lines
clamp

Clamp values
as.logical

Change cell values to logical or integer values
clearValues

Clear values
as.list

Create a list of RasterLayer objects
cellFrom

Get cell, row, or column number
calc

Calculate
cluster

Use a multi-core cluster
cellStats

Statistics across cells
addLayer

Add or drop a layer
colortable

colortable
cellsFromExtent

Cells from extent, and vice versa
blockSize

Block size for writing files
cut

Convert values to classes
compareRaster

Compare Raster objects
boundaries

boundaries (edges) detection
bind

Bind Spatial* objects
direction

Direction
disaggregate

Disaggregate
cv

Coefficient of variation
alignExtent

Align an extent (object of class Extent)
boxplot

Box plot of Raster objects
click

Query by clicking on a map
clump

Detect clumps
flip

Flip
drawExtent

Create an Extent object by drawing on a map
animate

Animate layers of a Raster* object
flowPath

Flow path
draw

Draw a line or polygon
extract

Extract values from Raster objects
getValues

Get raster cell values
distance

Distance
distanceFromPoints

Distance from points
bands

Number of bands
barplot

Bar plot of a RasterLayer
hillShade

Hill shading
extremeValues

Minimum and maximum values
hist

Histogram
factors

Factors
localFun

Local functions
brick

Create a RasterBrick object
as.data.frame

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

Character representation of a Raster or Extent object
atan2

Two argument arc-tangent
metadata

Metadata
pairs

Pairs plot (matrix of scatterplots)
mask

Mask values in a Raster object
overlay

Overlay Raster objects
modal

modal value
crop

Crop
Extract by index

Indexing to extract values of a Raster* object
hdr

Header files
compareCRS

Partially compare two CRS objects
crosstab

Cross-tabulate
focalWeight

Focal weights matrix
focal

Focal values
initialize

Initialize a Raster object with values
head

Show the head or tail of a Raster* object
interpolate

Interpolate
projection

Get or set a coordinate reference system (projection)
Options

Global options for the raster package
projectRaster

Project a Raster object
getValuesBlock

Get a block of raster cell values
origin

Origin
pointDistance

Distance between points
nlayers

Number of layers
getData

Get geographic data
plotRGB

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

Get the coordinates of a vector type Spatial* object
rasterFromCells

Subset a raster by cell numbers
contour

Contour plot
autocorrelation

Spatial autocorrelation
Extreme coordinates

Coordinates of the Extent of a Raster object
rasterFromXYZ

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

Temporary files
Extent math

round Extent coordinates
rasterize

Rasterize points, lines, or polygons
round

Integer values
inifile

Read a .ini file
shift

Shift
rasterToPolygons

Raster to polygons conversion
buffer

buffer
Slope and aspect

Slope and aspect
image

Image
density

Density plot
stack

Create a RasterStack object
readAll

Read values from disk
dim

Dimensions of a Raster* object
erase

dataType

Data type
stackApply

Apply a function on subsets of a RasterStack or RasterBrick
corLocal

Local correlation coefficient
union

Union Extent or SpatialPolygons* objects
cover

Replace NA values with values of other layers
extent

Extent
extension

Filename extensions
properties

Raster file properties
datasource

Are values in memory and/or on disk?
quantile

Raster quantiles
stackSave

Save or open a RasterStack file
scale

Scale values
match

Value matching for Raster* objects
merge

Merge Raster* objects
sampleRegular

Regular sample
validNames

Create valid names
validCell

Validity of a cell, column or row number
reclassify

Reclassify
z-values

Get or set z-values
sampleStratified

Stratified random sample
symdif

Symetrical difference
Summary

Summary
unique

Unique values
shapefile

Read or write a shapefile
setValues

Set values of a Raster object
rotate

Rotate
transpose

Transpose
trim

Trim
terrain

Terrain characteristics
text

Add labels to a map
rotated

Do the raster cells have a rotation?
sampleRandom

Random sample
SampleInt

Sample integer values
writeValues

Write values to a file
writeRaster

Write raster data to a file
xyFromCell

Coordinates from a row, column or cell number
freq

Frequency table
zApply

z (time) apply
filename

Filename
getValuesFocal

Get focal raster cell values
layerStats

Correlation and (weighted) covariance
gridDistance

Distance on a grid
extend

Extend
scalebar

scalebar
select

Geometric subsetting
filledContour

Filled contour plot
ncell

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

Names of raster layers
layerize

Layerize
Gain and offset

Gain and offset of values on file
predict

Spatial model predictions
raster-package

Overview of the functions in the raster package
movingFun

Moving functions
isLonLat

Is this longitude/latitude data?
Programming

Helper functions for programming
raster

Create a RasterLayer object
intersect

Intersect
plot

Plot a Raster* object
persp

Perspective plot
mosaic

Merge Raster* objects using a function for overlapping areas
resample

Resample a Raster object
rasterToContour

Raster to contour lines conversion
setExtent

Set the extent of a RasterLayer
rectify

rectify a Raster object
rasterToPoints

Raster to points conversion
resolution

Resolution
replacement

Replace cell values or layers of a Raster* object
rowFromCell

Row or column number from a cell number
rowSums

rowSums and colSums for Raster objects
sp

Create SpatialLines* or SpatialPolygons*
stackSelect

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

Use spplot to plot a Raster* or other object
substitute

Substitute values in a Raster* object
setMinMax

Compute min and max values
which

Which cells are TRUE?
weighted.mean

Weighted mean of rasters
subset

Subset layers in a Raster* object
zoom

Zoom in on a map
stretch

Stretch
zonal

Zonal statistics
which.min

Where is the min or max value?
unstack

Unstack
update

Update raster cells of files (on disk)
writeFormats

File types for writing