Learn R Programming

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

raster (version 2.3-24)

Geographic data analysis and modeling

Description

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

Copy Link

Version

Install

install.packages('raster')

Monthly Downloads

125,710

Version

2.3-24

License

GPL (>= 3)

Maintainer

Robert Hijmans

Last Published

January 27th, 2015

Functions in raster (2.3-24)

as.data.frame

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

Detect clumps
KML

Write a KML or KMZ file
adjacent

Adjacent cells
Gain and offset

Gain and offset of values on file
as.matrix

Get a matrix with raster cell values
interpolate

Interpolate
localFun

Local functions
metadata

Metadata
flip

Flip
Arith-methods

Arithmetic with Raster* objects
hdr

Header files
crosstab

Cross-tabulate
scalebar

scalebar
Summary-methods

Summary methods
rasterFromXYZ

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

Mathematical functions
contour

Contour plot
cluster

Use a multi-core cluster
gridDistance

Distance on a grid
getValues

Get raster cell values
approxNA

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

Distance from points
update

Update raster cells of files (on disk)
compareRaster

Compare Raster objects
image

Image
Logic-methods

Logical operators and functions
focal

Focal values
stack

Create a RasterStack object
transpose

Transpose
union

Union Extent or SpatialPolygons* objects
validNames

Create valid names
rotated

Do the raster cells have a rotation?
Slope and aspect

Slope and aspect
names

Names of raster layers
persp

Perspective plot
datasource

Are values in memory and/or on disk?
boundaries

boundaries (edges) detection
projection

Get or set a coordinate reference system (projection)
writeRaster

Write raster data to a file
blockSize

Block size for writing files
compareCRS

Partially compare two CRS objects
brick

Create a RasterBrick object
trim

Trim
mosaic

Merge Raster* objects using a function for overlapping areas
substitute

Substitute values in a Raster* object
z-values

Get or set z-values
getValuesBlock

Get a block of raster cell values
bind

Bind Spatial* objects
draw

Draw a line or polygon
properties

Raster file properties
addLayer

Add or drop a layer
layerize

Layerize
Extent coordinates

Coordinates of the Extent of a Raster object
rowFromCell

Row or column number from a cell number
shapefile

Read or write a shapefile
freq

Frequency table
symdif

Symetrical difference
corLocal

Local correlation coefficient
initialize

Intitialize a Raster object with values
projectRaster

Project a Raster object
cellFrom

Get cell, row, or column number
SampleInt

Sample integer values
stackApply

Apply a function on subsets of a RasterStack or RasterBrick
calc

Calculate
dim

Dimensions of a Raster* object
aggregate

Aggregate raster cells or polygons
Programming

Helper functions for programming
pointDistance

Distance between points
Extract by index

Indexing to extract values of a Raster* object
weighted.mean

Weighted mean of rasters
clearValues

Clear values
as.logical

Change values to logical
replacement

Replace cell values or layers of a Raster* object
spplot

Use spplot to plot a Raster* object
stackSave

Save or open a RasterStack file
Options

Global options for the raster package
sampleRegular

Regular sample
resample

Resample a Raster object
Compare-methods

Compare Raster* objects
erase

Erase parts of a Spatial* object
filledContour

Filled contour plot
shift

Shift
Summary

Summary
area

Size of cells
pairs

Pairs plot (matrix of scatterplots)
buffer

buffer
barplot

Bar plot of a RasterLayer
merge

Merge Raster* objects
boxplot

Box plot of Raster objects
click

Query by clicking on a map
hillShade

Hill shading
cover

Replace NA values with values of other layers
Extent math

round Extent coordinates
extend

Extend
inifile

Read a .ini file
clamp

Clamp values
predict

Spatial model predictions
distance

Distance
sampleRandom

Random sample
autocorrelation

Spatial autocorrelation
terrain

Terrain characteristics
raster-package

Overview of the functions in the raster package
zApply

z (time) apply
hist

Histogram
stackSelect

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

Origin
cellStats

Statistics across cells
filename

Filename
RGB

Create a Red-Green-Blue Raster object
sampleStratified

Stratified random sample
modal

modal value
cut

Convert values to classes
zonal

Zonal statistics
reclassify

Reclassify
setMinMax

Compute min and max values
which

Which cells are TRUE?
match

Value matching for Raster* objects
subset

Subset layers in a Raster* object
getData

Get geographic data
isLonLat

Is this longitude/latitude data?
text

Add labels to a map
direction

Direction
crop

Crop
xyFromCell

Coordinates from a row, column or cell number
plotRGB

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

Plot a Raster* object
extremeValues

Minimum and maximum values
NAvalue

Set the NA value of a RasterLayer
factors

Factors
as.raster

Coerce to a 'raster' object
focalWeight

Focal weights matrix
rasterToPolygons

Raster to polygons conversion
rectify

rectify a Raster object
quantile

Raster quantiles
ncell

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

Raster to points conversion
disaggregate

Disaggregate
bands

Number of bands
nlayers

Number of layers
writeFormats

File types for writing
setValues

Set values of a Raster object
select

Geometric subsetting
writeValues

Write values to a file
round

Integer values
unstack

Unstack
which.min

Where is the min or max value?
rotate

Rotate
flowPath

Flow path
raster

Create a RasterLayer object
scale

Scale values
unique

Unique values
getValuesFocal

Get focal raster cell values
head

Show the head or tail of a Raster* object
validCell

Validity of a cell, column or row number
intersect

Intersect
mask

Mask values in a Raster object
overlay

Overlay Raster objects
setExtent

Set the extent of a RasterLayer
animate

Animate layers of a Raster* object
alignExtent

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

Class "Extent"
layerStats

Correlation and (weighted) covariance
Raster-class

Raster* classes
rasterize

Rasterize points, lines, or polygons
atan2

Two argument arc-tangent
extension

Filename extensions
extract

Extract values from Raster objects
readAll

Read values from disk
movingFun

Moving functions
rasterFromCells

Subset a raster by cell numbers
resolution

Resolution
rasterToContour

Raster to contour lines conversion
zoom

Zoom in on a map
cellsFromExtent

Cells from Extent
density

Density plot
cv

Coefficient of variation
dataType

Data type
drawExtent

Create an Extent object by drawing on a map
extent

Extent
rasterTmpFile

Temporary files
stretch

Stretch