Learn R Programming

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

raster (version 2.0-12)

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 and processing of very large files is supported.

Copy Link

Version

Install

install.packages('raster')

Monthly Downloads

153,616

Version

2.0-12

License

GPL (>= 3)

Maintainer

Robert Hijmans

Last Published

September 2nd, 2012

Functions in raster (2.0-12)

as.matrix

Get a matrix with raster cell values
bands

Number of bands
Summary-methods

Summary methods
Math-methods

Mathematical functions
as.data.frame

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

scalebar
area

Size of cells
calc

Calculate
image

Image
unionExtent

Extent union
filename

Filename
brick

Create a RasterBrick object
drawExtent

Create an Extent object by drawing on a map
KML

Write a KML or KMZ file
Arith-methods

Arithmetic with Raster* objects
pairs

Pairs plot (matrix of scatterplots)
approxNA

Estimate values for cells that are NA
blockSize

Block size for writing files
getData

Get geographic data
persp

Perspective plot
rasterToContour

Raster to contour lines conversion
cellStats

Cell statistics
adjacent

Adjacent cells
cluster

Use a multi-core cluster
addLayer

Add or drop a layer
rasterToPoints

Raster to points conversion
Compare-methods

Compare Raster* objects
click

Click on a map
cellFrom

Get cell, row, or column number
edge

Edge detection
distance

Distance
as.logical

Change values to logical
compare

Compare
boxplot

Box plot of Raster objects
shift

Shift
Logic-methods

Logical operators and functions
cut

Convert values to classes
direction

Direction
density

Density plot
factors

Factors
initialize

Intitialize
Raster-class

Raster* classes
cv

Coefficient of variation
union

Union Extent
raster

Create a RasterLayer object
cellsFromExtent

Cells from Extent
rowFromCell

Row or column number from a cell number
setExtent

Set the extent of a RasterLayer
expand

Expand
rotated

Do the raster cells have a rotation?
shapefile

Read or write a shapefile
cover

Replace NA values with values of other layers
rectify

rectify a Raster object
intersect

Intersect Extent
count

Count
getValuesBlock

Get a block of raster cell values
atan2

Two argument arc-tangent
dataType

Data type
distanceFromPoints

Distance from points
projectRaster

Project a Raster object
adjacency

Pairs of adjacent cells
clearValues

Clear values
NAvalue

Set the NA value of a RasterLayer
modal

modal value
origin

Origin
datasource

Are values in memory and/or on disk?
raster-package

An overview of the functions in this package
flip

Flip
round

Integer values
crop

Crop
filledContour

Filled contour plot
inifile

Read a .ini file
extension

Filename extensions
match

Value matching for Raster* objects
readAll

Read values from disk
extract

Extract values from Raster objects
getValues

Get raster cell values
predict

Spatial model predictions
as.raster

Coerce to a 'raster' object
setValues

Set values of a Raster object
terrain

Terrain characteristics
rasterFromCells

Subset a raster by cell numbers
names

Names of raster layers
alignExtent

Align an extent (object of class Extent)
layerize

Layerize
draw

Draw a line or polygon
substitute

Substitute values in a Raster* object
weighted.mean

Weighted mean of rasters
Extract by index

Indexing to extract values of a Raster* object
getValuesFocal

Get focal raster cell values
rasterTmpFile

Temporary files
Extent math

round Extent coordinates
quantile

Raster quantiles
head

Show the head or tail of a Raster* object
plot

Plot a Raster* object
disaggregate

Disaggregate
reclassify

Reclassify
Gain and offset

Gain and offset of values on file
interpolate

Interpolate
overlay

Overlay Raster objects
focal

Focal values
SampleInt

Sample integer values
replacement

Replace cell values of a Raster* object
stack

Create a RasterStack object
Programming

Helper functions for programming
writeRaster

Write raster data to a file
zApply

z (time) apply
hillShade

Hill shading
setMinMax

Compute min and max values
ncell

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

Number of layers
text

Add labels to a map
subset

Subset layers in a Raster* object
xyFromCell

Coordinates from a row, column or cell number
autocorrelation

Spatial autocorrelation
intersectExtent

Extent intersection
gridDistance

Grid distance
writeFormats

File types for writing
extremeValues

Minimum and maximum values
crosstab

Cross-tabulate
mask

Mask values in a Raster object
hist

Histogram
movingFun

Moving functions
stackApply

Apply a function on subsets of a RasterStack or RasterBrick
reclass

Reclass
rasterToPolygons

Raster to polygons conversion
sampleRandom

Random sample
stackSave

Save or open a RasterStack file
rasterize

Rasterize points, lines, or polygons
trim

Trim
validCell

Validity of a cell, column or row number
zoom

Zoom in on a plot
mosaic

sampleStratified

Stratified random sample
spplot

Use spplot to plot a Raster* object
zonal

Zonal statistics
Options

Global options for the raster package
extent

Extent
resample

Resample a Raster object
writeValues

Write values to a file
transpose

Transpose
properties

Raster file properties
hdr

Header files
pointDistance

Distance between points
freq

Frequency table
projection

Get or set a coordinate reference system (projection)
z-values

Get or set z-values
merge

Merge Raster* objects
rotate

Rotate
resolution

Resolution
unique

Unique values
update

Update raster cells of files (on disk)
unstack

Unstack
Extent coordinates

Coordinates of the Extent of a Raster object
layerStats

Correlation and (weighted) covariance
isLonLat

Is this longitude/latitude data?
plotRGB

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

Create a RasterLayer from x, y, z values
Summary

Summary
which

Which cells are TRUE?
Extent-class

Class "Extent"
buffer

buffer
aggregate

Aggregate cells
clump

Detect clumps
contour

Contour plot
dim

Dimensions of a Raster* object
sampleRegular

Regular sample
stackSelect

Select cell values from a multi-layer Raster* object
Slope and aspect

Slope and aspect