Learn R Programming

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

raster (version 1.9-41)

Geographic analysis and modeling with raster data

Description

Reading, writing, manipulating, analyzing and modeling of gridded spatial data. The package implements basic and high-level functions, as well as map algebra. Processing of very large files is supported.

Copy Link

Version

Install

install.packages('raster')

Monthly Downloads

153,616

Version

1.9-41

License

GPL (>= 3)

Maintainer

Robert Hijmans

Last Published

November 10th, 2011

Functions in raster (1.9-41)

as.matrix

Get a matrix with raster cell values
getValues

Get raster cell values
cellFrom

Get cell, row, or column number
as.data.frame

Get a data.frame with raster cell values
rectify

rectify a Raster object
clump

Detect clumps
extension

Filename extensions
merge

Merge
persp

Perspective plot
cluster

Use a multi-core cluster
as.raster

Coerce to a 'raster' object
blockSize

Block size for writing files
flip

Flip
crop

Crop
expand

Expand
Logic-methods

Logical operators and functions
addLayer

Add or drop a layer
boxplot

Box plot of Raster objects
SampleInt

Sample integer values
bands

Number of bands
aggregate

Aggregate cells
mask

Mask values in a Raster object
click

Click on a map
pairs

Pairs plot (matrix of scatterplots)
writeValues

Write values to a file
inifile

Read a .ini file
shift

Shift
as.logical

Change values to logical
getValuesBlock

Get a block of raster cell values
extremeValues

Minimum and maximum values
Arith-methods

Arithmic with Raster* objects
ncell

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

Set the NA value of a RasterLayer
quantile

Raster quantiles
rasterTmpFile

Temporary files
hdr

Header files
Math-methods

Mathematical functions
zApply

z (time) apply
cellsFromExtent

Cells from Extent
scalebar

scalebar
dim

Dimensions of a Raster* object
unstack

Unstack
unique

Unique values
alignExtent

Align an extent (object of class Extent)
stack

Create a RasterStack object
extract

Extract values from Raster objects
crosstab

Cross-tabulate
clearValues

Clear values
distanceFromPoints

Distance from points
interpolate

Interpolate
nudgeExtent

Round extent coordinates
getData

Get geographic data
which

Which cells are TRUE?
contour

Contour plot
setMinMax

Compute min and max values
isLonLat

Is this longitude/latitude data?
properties

Raster file properties
head

Show the head or tail of a Raster* object
disaggregate

Disaggregate
Slope and aspect

Slope and aspect
initialize

Intitialize
predict

Spatial model predictions
setValues

Set values of a Raster object
direction

Direction
cellStats

Cell statistics
Summary

Summary
misc stats

Miscellaneous statistical functions
Raster-class

Raster* classes
raster-package

An overview of the functions in this package
writeFormats

File types for writing
plot

Plot a Raster* object
edge

Edge detection
subset

Subset layers in a Raster* object
KML

Write a KML or KMZ file
movingFun

Moving functions
nlayers

Number of layers
saverasterstack

Save or open a RasterStack file
mosaic

Merge Raster* objects, using a function to compute cell value for overlapping areas.
zoom

Zoom in on a plot
validCell

Validity of a cell, column or row number
draw

Draw a line or polygon
reclass

Reclassify
polygonFromExtent

Polygon from Extent
Extent-class

Class "Extent"
Options

Global options for the raster package
sampleRandom

Random sample
pointDistance

Distance between points
freq

Frequency table
rotated

Do the raster cells have a rotation?
brick

Create a RasterBrick object
match

Value matching for Raster* objects
intersectExtent

Extent intersection
extent

Extent
stackApply

Apply a function on subsets of a RasterStack or RasterBrick
sampleRegular

Regular sample
rasterize

Rasterize points, lines, or polygons
plotRGB

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

Extent union
rowFromCell

Row or column number from a cell number
cover

Replace NA values with values of other layers
filename

Filename
spplot

Use spplot to plot a Raster* object
focal_old

Focal (old functions)
resolution

Resolution
rasterToContour

Raster to contour lines conversion
setExtent

Set the extent of a RasteLayer
Extent coordinates

Coordinates of the Extent of a Raster object
stackSelect

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

Compare
writeRaster

Write raster data to a file
rasterFromCells

Subset a raster by cell numbers
rasterFromXYZ

Create a RasterLayer from x, y, z values
Summary-methods

Summary methods
Gain and offset

Gain and offset of values on file
update

Update raster cells of files (on disk)
round

Integer values
rasterToPolygons

Raster to polygons conversion
calc

Calculate
filledContour

Filled contour plot
gridDistance

Grid distance
raster

Create a RasterLayer object
approxNA

Estimate values for cells that are NA
autocorrelation

Spatial autocorrelation
dataType

Data type
density

Density plot
origin

Origin
xyFromCell

Coordinates from a row, column or cell number
projection

Get or set a projection
z-values

Get or set z-values
image

Image
distance

Distance
projectRaster

Project a Raster object
hillShade

Hill shading
hist

Histogram
rasterToPoints

Raster to points conversion
terrain

Terrain characteristics
substitute

Substitute values in a RasterLayer
resample

Resample a Raster object
replacement

Replace cell values of a Raster* object
factors

Factors
Compare-methods

Compare Raster* objects
obsolete

Obsolete functions
adjacent

Adjacent cells
atan2

Two argument arc-tangent
count

Count
readAll

Read values from disk
trim

Trim
transpose

Transpose
overlay

Overlay Raster objects
adjacency

Pairs of adjacent cells
Extract by index

Indexing to extract values of a Raster* object
zonal

Zonal statistics
focal

Focal values
area

Size of cells
cut

Convert values to classes
datasource

Are values in memory and/or on disk?
Programming

Helper functions for programming
rotate

Rotate
drawExtent

Create an Extent object by drawing on a map