Learn R Programming

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

raster (version 2.2-31)

raster: 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

119,565

Version

2.2-31

License

GPL (>= 3)

Maintainer

Robert Hijmans

Last Published

March 7th, 2014

Functions in raster (2.2-31)

as.logical

Change values to logical
RGB

Create a Red-Green-Blue Raster object
bands

Number of bands
Extent-class

Class "Extent"
Extract by index

Indexing to extract values of a Raster* object
approxNA

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

Two argument arc-tangent
cv

Coefficient of variation
dataType

Data type
extract

Extract values from Raster objects
alignExtent

Align an extent (object of class Extent)
factors

Factors
Arith-methods

Arithmetic with Raster* objects
image

Image
subset

Subset layers in a Raster* object
rectify

rectify a Raster object
Compare-methods

Compare Raster* objects
as.raster

Coerce to a 'raster' object
KML

Write a KML or KMZ file
cellFrom

Get cell, row, or column number
flip

Flip
hist

Histogram
blockSize

Block size for writing files
click

Query by clicking on a map
clearValues

Clear values
crosstab

Cross-tabulate
compareCRS

Partially compare two CRS objects
as.data.frame

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

Mathematical functions
filename

Filename
Raster-class

Raster* classes
names

Names of raster layers
rasterToPoints

Raster to points conversion
modal

modal value
boxplot

Box plot of Raster objects
scale

Scale values
writeRaster

Write raster data to a file
direction

Direction
clamp

Clamp values
inifile

Read a .ini file
quantile

Raster quantiles
plotRGB

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

Erase parts of a Spatial* object
layerStats

Correlation and (weighted) covariance
extent

Extent
autocorrelation

Spatial autocorrelation
predict

Spatial model predictions
hillShade

Hill shading
Options

Global options for the raster package
clump

Detect clumps
addLayer

Add or drop a layer
extension

Filename extensions
sampleRegular

Regular sample
interpolate

Interpolate
getValues

Get raster cell values
sampleStratified

Stratified random sample
rasterToContour

Raster to contour lines conversion
getValuesBlock

Get a block of raster cell values
buffer

buffer
focalWeight

Focal weights matrix
initialize

Intitialize
cellStats

Statistics across cells
extend

Extend
writeValues

Write values to a file
distance

Distance
zoom

Zoom in on a plot
properties

Raster file properties
transpose

Transpose
zonal

Zonal statistics
cover

Replace NA values with values of other layers
rasterToPolygons

Raster to polygons conversion
reclassify

Reclassify
drawExtent

Create an Extent object by drawing on a map
Summary

Summary
isLonLat

Is this longitude/latitude data?
origin

Origin
area

Size of cells
rotated

Do the raster cells have a rotation?
rasterTmpFile

Temporary files
raster-package

Overview of the functions in the raster package
contour

Contour plot
pointDistance

Distance between points
round

Integer values
trim

Trim
dim

Dimensions of a Raster* object
merge

Merge Raster* objects
mosaic

Merge Raster* objects using a function for overlapping areas
substitute

Substitute values in a Raster* object
Extent math

round Extent coordinates
overlay

Overlay Raster objects
flowPath

Flow path
ncell

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

Resolution
stackApply

Apply a function on subsets of a RasterStack or RasterBrick
bind

Bind Spatial* objects
persp

Perspective plot
projection

Get or set a coordinate reference system (projection)
readAll

Read values from disk
Slope and aspect

Slope and aspect
which

Which cells are TRUE?
sampleRandom

Random sample
stackSave

Save or open a RasterStack file
rasterize

Rasterize points, lines, or polygons
union

Union Extent or SpatialPolygons* objects
NAvalue

Set the NA value of a RasterLayer
xyFromCell

Coordinates from a row, column or cell number
disaggregate

Disaggregate
stackSelect

Select cell values from a multi-layer Raster* object
Summary-methods

Summary methods
shift

Shift
as.matrix

Get a matrix with raster cell values
scalebar

scalebar
shapefile

Read or write a shapefile
stack

Create a RasterStack object
extremeValues

Minimum and maximum values
boundaries

boundaries (edges) detection
filledContour

Filled contour plot
adjacent

Adjacent cells
cluster

Use a multi-core cluster
stretch

Stretch
draw

Draw a line or polygon
setValues

Set values of a Raster object
crop

Crop
mask

Mask values in a Raster object
terrain

Terrain characteristics
symdif

Symetrical difference
Programming

Helper functions for programming
resample

Resample a Raster object
cellsFromExtent

Cells from Extent
writeFormats

File types for writing
Extent coordinates

Coordinates of the Extent of a Raster object
cut

Convert values to classes
density

Density plot
Gain and offset

Gain and offset of values on file
validNames

Create valid names
validCell

Validity of a cell, column or row number
distanceFromPoints

Distance from points
head

Show the head or tail of a Raster* object
layerize

Layerize
setMinMax

Compute min and max values
text

Add labels to a map
raster

Create a RasterLayer object
replacement

Replace cell values or layers of a Raster* object
animate

Animate layers of a Raster* object
metadata

Metadata
gridDistance

Distance on a grid
plot

Plot a Raster* object
calc

Calculate
getData

Get geographic data
projectRaster

Project a Raster object
movingFun

Moving functions
rowFromCell

Row or column number from a cell number
rotate

Rotate
rasterFromCells

Subset a raster by cell numbers
setExtent

Set the extent of a RasterLayer
SampleInt

Sample integer values
select

Geometric subsetting
unique

Unique values
Logic-methods

Logical operators and functions
barplot

Bar plot of a RasterLayer
intersect

Intersect
rasterFromXYZ

Create a RasterLayer from x, y, z values
hdr

Header files
spplot

Use spplot to plot a Raster* object
corrLocal

Local correlation coefficient
datasource

Are values in memory and/or on disk?
focal

Focal values
unstack

Unstack
which.min

Where is the min or max value?
z-values

Get or set z-values
brick

Create a RasterBrick object
compareRaster

Compare Raster objects
aggregate

Aggregate raster cells or polygons
freq

Frequency table
getValuesFocal

Get focal raster cell values
match

Value matching for Raster* objects
nlayers

Number of layers
pairs

Pairs plot (matrix of scatterplots)
update

Update raster cells of files (on disk)
weighted.mean

Weighted mean of rasters
zApply

z (time) apply