Learn R Programming

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

raster (version 2.9-23)

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

153,616

Version

2.9-23

License

GPL (>= 3)

Maintainer

Robert Hijmans

Last Published

July 11th, 2019

Functions in raster (2.9-23)

KML

Write a KML or KMZ file
Raster-class

Raster* classes
Compare-methods

Compare Raster* objects
NAvalue

Set the NA value of a RasterLayer
Extent-class

Class "Extent"
Arith-methods

Arithmetic with Raster* objects
Rcpp-class

Rcpp classes
RGB

Create a Red-Green-Blue Raster object
Logic-methods

Logical operators and functions
Math-methods

Mathematical functions
Summary-methods

Summary methods
approxNA

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

Number of bands
boundaries

boundaries (edges) detection
area

Size of cells
barplot

Bar plot of a RasterLayer
boxplot

Box plot of Raster objects
aggregate

Aggregate raster cells or SpatialPolygons/Lines
as.raster

Coerce to a 'raster' object
as.matrix

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

Adjacent cells
clamp

Clamp values
alignExtent

Align an extent (object of class Extent)
animate

Animate layers of a Raster* object
addLayer

Add or drop a layer
cluster

Use a multi-core cluster
clearValues

Clear values
as.list

Create a list of RasterLayer objects
buffer

buffer
density

Density plot
brick

Create a RasterBrick object
click

Query by clicking on a map
clump

Detect clumps
as.logical

Change cell values to logical or integer values
calc

Calculate
colortable

colortable
direction

Direction
bind

Bind Spatial* objects
filename

Filename
draw

Draw a line or polygon
contour

Contour plot
cellFrom

Get cell, row, or column number
Extreme coordinates

Coordinates of the Extent of a Raster object
drawExtent

Create an Extent object by drawing on a map
flip

Flip
datasource

Are values in memory and/or on disk?
flowPath

Flow path
dataType

Data type
as.character

Character representation of a Raster or Extent object
disaggregate

Disaggregate
dim

Dimensions of a Raster* object
isLonLat

Is this longitude/latitude data?
getValuesBlock

Get a block of raster cell values
intersect

Intersect
extension

Filename extensions
getValues

Get raster cell values
extent

Extent
nlayers

Number of layers
filledContour

Filled contour plot
blockSize

Block size for writing files
atan2

Two argument arc-tangent
corLocal

Local correlation coefficient
as.data.frame

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

Spatial autocorrelation
origin

Origin
predict

Spatial model predictions
Programming

Helper functions for programming
projectRaster

Project a Raster object
rotated

Do the raster cells have a rotation?
rasterFromCells

Subset a raster by cell numbers
rotate

Rotate
rasterFromXYZ

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

Get or set a coordinate reference system (projection)
properties

Raster file properties
quantile

Raster quantiles
cellStats

Statistics across cells
getValuesFocal

Get focal raster cell values
extremeValues

Minimum and maximum values
crop

Crop
distance

Distance
crosstab

Cross-tabulate
cover

Replace NA values with values of other layers
factors

Factors
cellsFromExtent

Cells from extent, and vice versa
distanceFromPoints

Distance from points
resample

Resample a Raster object
erase

focalWeight

Focal weights matrix
extend

Extend
mask

Mask values in a Raster object
localFun

Local functions
hist

Histogram
hillShade

Hill shading
names

Names of raster layers
focal

Focal values
ncell

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

Header files
pairs

Pairs plot (matrix of scatterplots)
rasterToPoints

Raster to points conversion
overlay

Overlay Raster objects
rasterToContour

Raster to contour lines conversion
compareCRS

Partially compare two CRS objects
cv

Coefficient of variation
compareRaster

Compare Raster objects
cut

Convert values to classes
head

Show the head or tail of a Raster* object
rasterize

Rasterize points, lines, or polygons
rasterToPolygons

Raster to polygons conversion
resolution

Resolution
image

Image
round

Integer values
layerStats

Correlation and (weighted) covariance
metadata

Metadata
gridDistance

Distance on a grid
modal

modal value
layerize

Layerize
terrain

Terrain characteristics
persp

Perspective plot
plot

Plot a Raster* object
inifile

Read a .ini file
mosaic

Merge Raster* objects using a function for overlapping areas
shift

Shift
Extent math

round Extent coordinates
extract

Extract values from Raster objects
Extract by index

Indexing to extract values of a Raster* object
plotRGB

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

Moving functions
freq

Frequency table
geom

Get the coordinates of a vector type Spatial* object
Gain and offset

Gain and offset of values on file
Slope and aspect

Slope and aspect
getData

Get geographic data
sampleStratified

Stratified random sample
sampleRegular

Regular sample
interpolate

Interpolate
match

Value matching for Raster* objects
initialize

Initialize a Raster object with values
text

Add labels to a map
scalebar

scalebar
unstack

Unstack
merge

Merge Raster* objects
substitute

Substitute values in a Raster* object
update

Update raster cells of files (on disk)
subset

Subset layers in a Raster* object
readAll

Read values from disk
Options

Global options for the raster package
rasterTmpFile

Temporary files
select

Geometric subsetting
reclassify

Reclassify
SampleInt

Sample integer values
pointDistance

Distance between points
raster-package

Overview of the functions in the raster package
sampleRandom

Random sample
raster

Create a RasterLayer object
setExtent

Set the extent of a RasterLayer
rowSums

rowSums and colSums for Raster objects
rowFromCell

Row or column number from a cell number
setMinMax

Compute min and max values
sp

Create SpatialLines* or SpatialPolygons*
spplot

Use spplot to plot a Raster* object
zApply

z (time) apply
xyFromCell

Coordinates from a row, column or cell number
rectify

rectify a Raster object
zonal

Zonal statistics
zoom

Zoom in on a map
replacement

Replace cell values or layers of a Raster* object
Summary

Summary
stackSave

Save or open a RasterStack file
stack

Create a RasterStack object
stackApply

Apply a function on subsets of a RasterStack or RasterBrick
union

Union Extent or SpatialPolygons* objects
symdif

Symetrical difference
unique

Unique values
transpose

Transpose
stackSelect

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

Set values of a Raster object
scale

Scale values
stretch

Stretch
shapefile

Read or write a shapefile
weighted.mean

Weighted mean of rasters
which

Which cells are TRUE?
trim

Trim
writeRaster

Write raster data to a file
writeValues

Write values to a file
which.min

Where is the min or max value?
writeFormats

File types for writing
validCell

Validity of a cell, column or row number
validNames

Create valid names
z-values

Get or set z-values