Learn R Programming

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

raster (version 3.5-29)

Geographic Data Analysis and Modeling

Description

Reading, writing, manipulating, analyzing and modeling of spatial data. The package implements basic and high-level functions for raster data and 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

154,521

Version

3.5-29

License

GPL (>= 3)

Maintainer

Robert Hijmans

Last Published

August 14th, 2022

Functions in raster (3.5-29)

Logic-methods

Logical operators and functions
NAvalue

Set the NA value of a RasterLayer
Raster-class

Raster* classes
Math-methods

Mathematical functions
Compare-methods

Compare Raster* objects
Rcpp-class

Rcpp classes
Arith-methods

Arithmetic with Raster* objects
RGB

Create a Red-Green-Blue Raster object
KML

Write a KML or KMZ file
Extent-class

Class "Extent"
as.matrix

Get a vector, matrix, or array with raster cell values
Summary-methods

Summary methods
addLayer

Add or drop a layer
as.data.frame

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

Coerce to a 'raster' object
as.character

Character representation of a Raster or Extent object
as.list

Create a list of RasterLayer objects
bind

Bind Spatial* objects
blockSize

Block size for writing files
alignExtent

Align an extent (object of class Extent)
as.logical

Change cell values to logical or integer values
animate

Animate layers of a Raster* object
boundaries

boundaries (edges) detection
atan2

Two argument arc-tangent
approxNA

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

Size of cells
adjacent

Adjacent cells
boxplot

Box plot of Raster objects
aggregate

Aggregate raster cells or SpatialPolygons/Lines
autocorrelation

Spatial autocorrelation
bands

Number of bands
barplot

Bar plot of a RasterLayer
brick

Create a RasterBrick object
cover

Replace NA values with values of other layers
corLocal

Local correlation coefficient
clamp

Clamp values
cellStats

Statistics across cells
click

Query by clicking on a map
clearValues

Clear values
buffer

buffer
contour

Contour plot
Extreme coordinates

Coordinates of the Extent of a Raster object
cellsFromExtent

Cells from extent, and vice versa
calc

Calculate
cut

Convert values to classes
cv

Coefficient of variation
clump

Detect clumps
cellFrom

Get cell, row, or column number
compareRaster

Compare Raster objects
hillShade

Hill shading
hist

Histogram
compareCRS

Partially compare two CRS objects
direction

Direction
isLonLat

Is this longitude/latitude data?
intersect

Intersect
metadata

Metadata
disaggregate

Disaggregate
modal

modal value
density

Density plot
colortable

colortable
cluster

Use a multi-core cluster
projectRaster

Project a Raster object
dim

Dimensions of a Raster* object
dataType

Data type
datasource

Are values in memory and/or on disk?
projection

Get or set a coordinate reference system (projection)
crosstab

Cross-tabulate
crop

Crop
rotate

Rotate
rotated

Do the raster cells have a rotation?
flip

Flip
extension

Filename extensions
extend

Extend
erase

flowPath

Flow path
distance

Distance
extract

Extract values from Raster objects
extent

Extent
setExtent

Set the extent of a RasterLayer
Extract by index

Indexing to extract values of a Raster* object
extremeValues

Minimum and maximum values
round

Integer values
Extent math

round Extent coordinates
setMinMax

Compute min and max values
Gain and offset

Gain and offset of values on file
freq

Frequency table
factors

Factors
distanceFromPoints

Distance from points
getValuesBlock

Get a block of raster cell values
focal

Focal values
focalWeight

Focal weights matrix
getValues

Get raster cell values
image

Image
getData

Get geographic data
geom

Get the coordinates of a vector type Spatial* object
names

Names of raster layers
inifile

Read a .ini file
persp

Perspective plot
ncell

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

Merge Raster* objects using a function for overlapping areas
plot

Plot a Raster* object
raster-package

Overview of the functions in the raster package
movingFun

Moving functions
draw

Draw a line or polygon
drawExtent

Create an Extent object by drawing on a map
stackSelect

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

Create a RasterLayer object
rasterToPolygons

Raster to polygons conversion
rasterFromCells

Subset a raster by cell numbers
rasterFromXYZ

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

Filename
stretch

Stretch
rowFromCell

Row or column number from a cell number
rasterize

Rasterize points, lines, or polygons
SampleInt

Sample integer values
update

Update raster cells of files (on disk)
unstack

Unstack
Slope and aspect

Slope and aspect
shift

Shift
rowSums

rowSums and colSums for Raster objects
filledContour

Filled contour plot
getValuesFocal

Get focal raster cell values
hdr

Header files
gridDistance

Distance on a grid
which.min

Where is the min or max value?
writeFormats

File types for writing
sampleRandom

Random sample
head

Show the head or tail of a Raster* object
initialize

Initialize a Raster object with values
interpolate

Interpolate
localFun

Local functions
mask

Mask values in a Raster object
subset

Subset layers in a Raster* object
overlay

Overlay Raster objects
substitute

Substitute values in a Raster* object
pairs

Pairs plot (matrix of scatterplots)
weighted.mean

Weighted mean of rasters
which

Which cells are TRUE?
layerStats

Correlation and (weighted) covariance
nlayers

Number of layers
origin

Origin
terrain

Terrain characteristics
pointDistance

Distance between points
unique

Unique values
union

Union Extent or SpatialPolygons* objects
text

Add labels to a map
plotRGB

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

Layerize
rasterToContour

Raster to contour lines conversion
readAll

Read values from disk
merge

Merge Raster* objects
reclassify

Reclassify
match

Value matching for Raster* objects
rasterToPoints

Raster to points conversion
Programming

Helper functions for programming
predict

Spatial model predictions
select

Geometric subsetting
scalebar

scalebar
properties

Raster file properties
z-values

Get or set z-values
rectify

rectify a Raster object
quantile

Raster quantiles
stackApply

Apply a function on subsets of a RasterStack or RasterBrick
stack

Create a RasterStack object
Options

Global options for the raster package
rasterTmpFile

Temporary files
scale

Scale values
stackSave

Save or open a RasterStack file
replacement

Replace cell values or layers of a Raster* object
spEasy

Create SpatialLines* or SpatialPolygons*
spplot

Use spplot to plot a Raster* or other object
zApply

z (time) apply
xyFromCell

Coordinates from a row, column or cell number
resample

Resample a Raster object
sampleRegular

Regular sample
resolution

Resolution
shapefile

Read or write a shapefile
sampleStratified

Stratified random sample
setValues

Set values of a Raster object
validNames

Create valid names
validCell

Validity of a cell, column or row number
writeRaster

Write raster data to a file
writeValues

Write values to a file
transpose

Transpose
symdif

Symetrical difference
trim

Trim
Summary

Summary
zonal

Zonal statistics
zoom

Zoom in on a map