Learn R Programming

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

raster (version 2.9-22)

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. There is a also support 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

171,298

Version

2.9-22

License

GPL (>= 3)

Maintainer

Robert Hijmans

Last Published

July 10th, 2019

Functions in raster (2.9-22)

Raster-class

Raster* classes
adjacent

Adjacent cells
aggregate

Aggregate raster cells or SpatialPolygons/Lines
as.raster

Coerce to a 'raster' object
buffer

buffer
Rcpp-class

Rcpp classes
as.matrix

Get a vector, matrix, or array with raster cell values
brick

Create a RasterBrick object
animate

Animate layers of a Raster* object
alignExtent

Align an extent (object of class Extent)
compareRaster

Compare Raster objects
compareCRS

Partially compare two CRS objects
factors

Factors
extremeValues

Minimum and maximum values
cv

Coefficient of variation
cut

Convert values to classes
getValuesFocal

Get focal raster cell values
mosaic

Merge Raster* objects using a function for overlapping areas
gridDistance

Distance on a grid
Extent-class

Class "Extent"
bands

Number of bands
barplot

Bar plot of a RasterLayer
Arith-methods

Arithmetic with Raster* objects
Compare-methods

Compare Raster* objects
cellStats

Statistics across cells
NAvalue

Set the NA value of a RasterLayer
RGB

Create a Red-Green-Blue Raster object
approxNA

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

Write a KML or KMZ file
Logic-methods

Logical operators and functions
Summary-methods

Summary methods
area

Size of cells
Math-methods

Mathematical functions
atan2

Two argument arc-tangent
as.character

Character representation of a Raster or Extent object
as.data.frame

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

Distance
distanceFromPoints

Distance from points
autocorrelation

Spatial autocorrelation
cellsFromExtent

Cells from extent, and vice versa
contour

Contour plot
addLayer

Add or drop a layer
boxplot

Box plot of Raster objects
boundaries

boundaries (edges) detection
filename

Filename
filledContour

Filled contour plot
hillShade

Hill shading
clamp

Clamp values
as.list

Create a list of RasterLayer objects
as.logical

Change cell values to logical or integer values
clearValues

Clear values
Extreme coordinates

Coordinates of the Extent of a Raster object
movingFun

Moving functions
bind

Bind Spatial* objects
crop

Crop
click

Query by clicking on a map
rasterToPoints

Raster to points conversion
rasterToContour

Raster to contour lines conversion
persp

Perspective plot
plot

Plot a Raster* object
corLocal

Local correlation coefficient
cover

Replace NA values with values of other layers
density

Density plot
dim

Dimensions of a Raster* object
stackSave

Save or open a RasterStack file
blockSize

Block size for writing files
extract

Extract values from Raster objects
scale

Scale values
flip

Flip
Extract by index

Indexing to extract values of a Raster* object
flowPath

Flow path
dataType

Data type
extension

Filename extensions
datasource

Are values in memory and/or on disk?
clump

Detect clumps
extent

Extent
hist

Histogram
calc

Calculate
localFun

Local functions
Gain and offset

Gain and offset of values on file
freq

Frequency table
projectRaster

Project a Raster object
Options

Global options for the raster package
mask

Mask values in a Raster object
rasterTmpFile

Temporary files
projection

Get or set a coordinate reference system (projection)
setMinMax

Compute min and max values
setExtent

Set the extent of a RasterLayer
hdr

Header files
stack

Create a RasterStack object
layerStats

Correlation and (weighted) covariance
cellFrom

Get cell, row, or column number
rasterToPolygons

Raster to polygons conversion
drawExtent

Create an Extent object by drawing on a map
crosstab

Cross-tabulate
draw

Draw a line or polygon
geom

Get the coordinates of a vector type Spatial* object
getData

Get geographic data
stackApply

Apply a function on subsets of a RasterStack or RasterBrick
initialize

Initialize a Raster object with values
interpolate

Interpolate
nlayers

Number of layers
rasterize

Rasterize points, lines, or polygons
scalebar

scalebar
layerize

Layerize
origin

Origin
replacement

Replace cell values or layers of a Raster* object
rowSums

rowSums and colSums for Raster objects
pointDistance

Distance between points
rowFromCell

Row or column number from a cell number
rectify

rectify a Raster object
plotRGB

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

Show the head or tail of a Raster* object
image

Image
inifile

Read a .ini file
setValues

Set values of a Raster object
cluster

Use a multi-core cluster
ncell

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

Names of raster layers
disaggregate

Disaggregate
colortable

colortable
direction

Direction
extend

Extend
erase

focalWeight

Focal weights matrix
focal

Focal values
getValues

Get raster cell values
select

Geometric subsetting
Summary

Summary
merge

Merge Raster* objects
match

Value matching for Raster* objects
rasterFromCells

Subset a raster by cell numbers
Programming

Helper functions for programming
properties

Raster file properties
predict

Spatial model predictions
unique

Unique values
union

Union Extent or SpatialPolygons* objects
zonal

Zonal statistics
symdif

Symetrical difference
quantile

Raster quantiles
validCell

Validity of a cell, column or row number
writeFormats

File types for writing
validNames

Create valid names
which.min

Where is the min or max value?
rasterFromXYZ

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

Resample a Raster object
resolution

Resolution
round

Integer values
Extent math

round Extent coordinates
rotate

Rotate
text

Add labels to a map
terrain

Terrain characteristics
trim

Trim
transpose

Transpose
getValuesBlock

Get a block of raster cell values
zoom

Zoom in on a map
intersect

Intersect
overlay

Overlay Raster objects
metadata

Metadata
modal

modal value
isLonLat

Is this longitude/latitude data?
rotated

Do the raster cells have a rotation?
SampleInt

Sample integer values
shapefile

Read or write a shapefile
pairs

Pairs plot (matrix of scatterplots)
raster-package

Overview of the functions in the raster package
sampleRandom

Random sample
sp

Create SpatialLines* or SpatialPolygons*
unstack

Unstack
spplot

Use spplot to plot a Raster* object
writeValues

Write values to a file
writeRaster

Write raster data to a file
update

Update raster cells of files (on disk)
raster

Create a RasterLayer object
reclassify

Reclassify
readAll

Read values from disk
substitute

Substitute values in a Raster* object
subset

Subset layers in a Raster* object
shift

Shift
sampleStratified

Stratified random sample
sampleRegular

Regular sample
Slope and aspect

Slope and aspect
stretch

Stretch
xyFromCell

Coordinates from a row, column or cell number
zApply

z (time) apply
stackSelect

Select cell values from a multi-layer Raster* object
weighted.mean

Weighted mean of rasters
which

Which cells are TRUE?
z-values

Get or set z-values