Learn R Programming

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

raster (version 2.3-40)

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

153,616

Version

2.3-40

License

GPL (>= 3)

Maintainer

Robert Hijmans

Last Published

April 11th, 2015

Functions in raster (2.3-40)

blockSize

Block size for writing files
freq

Frequency table
calc

Calculate
extension

Filename extensions
resolution

Resolution
localFun

Local functions
image

Image
raster-package

Overview of the functions in the raster package
pointDistance

Distance between points
transpose

Transpose
barplot

Bar plot of a RasterLayer
as.matrix

Get a matrix with raster cell values
clamp

Clamp values
cellsFromExtent

Cells from Extent
distance

Distance
bind

Bind Spatial* objects
click

Query by clicking on a map
sampleStratified

Stratified random sample
compareRaster

Compare Raster objects
inifile

Read a .ini file
as.logical

Change values to logical
dim

Dimensions of a Raster* object
stack

Create a RasterStack object
Extract by index

Indexing to extract values of a Raster* object
getData

Get geographic data
factors

Factors
contour

Contour plot
focalWeight

Focal weights matrix
crop

Crop
hillShade

Hill shading
head

Show the head or tail of a Raster* object
Summary

Summary
Gain and offset

Gain and offset of values on file
extract

Extract values from Raster objects
hdr

Header files
overlay

Overlay Raster objects
hist

Histogram
writeRaster

Write raster data to a file
reclassify

Reclassify
addLayer

Add or drop a layer
buffer

buffer
stackSave

Save or open a RasterStack file
which.min

Where is the min or max value?
rasterToPoints

Raster to points conversion
area

Size of cells
shapefile

Read or write a shapefile
initialize

Intitialize a Raster object with values
zApply

z (time) apply
interpolate

Interpolate
ncell

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

Get cell, row, or column number
mask

Mask values in a Raster object
sampleRegular

Regular sample
layerStats

Correlation and (weighted) covariance
cluster

Use a multi-core cluster
metadata

Metadata
projection

Get or set a coordinate reference system (projection)
rasterFromXYZ

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

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

Rasterize points, lines, or polygons
animate

Animate layers of a Raster* object
persp

Perspective plot
focal

Focal values
cellStats

Statistics across cells
rasterToPolygons

Raster to polygons conversion
trim

Trim
plotRGB

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

Project a Raster object
Extent-class

Class "Extent"
aggregate

Aggregate raster cells or polygons
Extent math

round Extent coordinates
symdif

Symetrical difference
distanceFromPoints

Distance from points
RGB

Create a Red-Green-Blue Raster object
unique

Unique values
union

Union Extent or SpatialPolygons* objects
rasterFromCells

Subset a raster by cell numbers
rotate

Rotate
SampleInt

Sample integer values
clump

Detect clumps
draw

Draw a line or polygon
quantile

Raster quantiles
autocorrelation

Spatial autocorrelation
readAll

Read values from disk
density

Density plot
filename

Filename
extremeValues

Minimum and maximum values
erase

Erase parts of a Spatial* object
substitute

Substitute values in a Raster* object
cover

Replace NA values with values of other layers
pairs

Pairs plot (matrix of scatterplots)
getValuesBlock

Get a block of raster cell values
select

Geometric subsetting
as.raster

Coerce to a 'raster' object
NAvalue

Set the NA value of a RasterLayer
brick

Create a RasterBrick object
shift

Shift
disaggregate

Disaggregate
sp

Create SpatialLines* or SpatialPolygons*
stackApply

Apply a function on subsets of a RasterStack or RasterBrick
text

Add labels to a map
setMinMax

Compute min and max values
Extent coordinates

Coordinates of the Extent of a Raster object
boxplot

Box plot of Raster objects
intersect

Intersect
filledContour

Filled contour plot
zonal

Zonal statistics
mosaic

Merge Raster* objects using a function for overlapping areas
rowFromCell

Row or column number from a cell number
predict

Spatial model predictions
datasource

Are values in memory and/or on disk?
names

Names of raster layers
nlayers

Number of layers
zoom

Zoom in on a map
gridDistance

Distance on a grid
plot

Plot a Raster* object
getValuesFocal

Get focal raster cell values
extend

Extend
raster

Create a RasterLayer object
subset

Subset layers in a Raster* object
resample

Resample a Raster object
properties

Raster file properties
Math-methods

Mathematical functions
rasterToContour

Raster to contour lines conversion
Options

Global options for the raster package
as.data.frame

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

Helper functions for programming
drawExtent

Create an Extent object by drawing on a map
origin

Origin
scalebar

scalebar
sampleRandom

Random sample
stretch

Stretch
Summary-methods

Summary methods
KML

Write a KML or KMZ file
which

Which cells are TRUE?
bands

Number of bands
setExtent

Set the extent of a RasterLayer
cut

Convert values to classes
weighted.mean

Weighted mean of rasters
stackSelect

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

Flip
layerize

Layerize
Slope and aspect

Slope and aspect
round

Integer values
z-values

Get or set z-values
Raster-class

Raster* classes
Arith-methods

Arithmetic with Raster* objects
terrain

Terrain characteristics
writeFormats

File types for writing
isLonLat

Is this longitude/latitude data?
alignExtent

Align an extent (object of class Extent)
clearValues

Clear values
validNames

Create valid names
modal

modal value
dataType

Data type
extent

Extent
flowPath

Flow path
corLocal

Local correlation coefficient
getValues

Get raster cell values
direction

Direction
rectify

rectify a Raster object
scale

Scale values
match

Value matching for Raster* objects
merge

Merge Raster* objects
rotated

Do the raster cells have a rotation?
spplot

Use spplot to plot a Raster* object
movingFun

Moving functions
rasterTmpFile

Temporary files
validCell

Validity of a cell, column or row number
replacement

Replace cell values or layers of a Raster* object
setValues

Set values of a Raster object
writeValues

Write values to a file
Logic-methods

Logical operators and functions
adjacent

Adjacent cells
Compare-methods

Compare Raster* objects
boundaries

boundaries (edges) detection
compareCRS

Partially compare two CRS objects
crosstab

Cross-tabulate
atan2

Two argument arc-tangent
cv

Coefficient of variation
unstack

Unstack
xyFromCell

Coordinates from a row, column or cell number
update

Update raster cells of files (on disk)