Learn R Programming

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

raster (version 3.5-15)

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

140,904

Version

3.5-15

License

GPL (>= 3)

Maintainer

Last Published

January 22nd, 2022

Functions in raster (3.5-15)

as.character

Character representation of a Raster or Extent object
cellsFromExtent

Cells from extent, and vice versa
cellStats

Statistics across cells
Logic-methods

Logical operators and functions
alignExtent

Align an extent (object of class Extent)
Math-methods

Mathematical functions
autocorrelation

Spatial autocorrelation
clamp

Clamp values
atan2

Two argument arc-tangent
animate

Animate layers of a Raster* object
corLocal

Local correlation coefficient
cover

Replace NA values with values of other layers
NAvalue

Set the NA value of a RasterLayer
Arith-methods

Arithmetic with Raster* objects
dataType

Data type
density

Density plot
draw

Draw a line or polygon
dim

Dimensions of a Raster* object
clearValues

Clear values
drawExtent

Create an Extent object by drawing on a map
RGB

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

Summary methods
datasource

Are values in memory and/or on disk?
extend

Extend
erase

addLayer

Add or drop a layer
approxNA

Estimate values for cell values that are NA by interpolating between layers
as.matrix

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

Size of cells
Compare-methods

Compare Raster* objects
flowPath

Flow path
flip

Flip
Rcpp-class

Rcpp classes
freq

Frequency table
Raster-class

Raster* classes
as.list

Create a list of RasterLayer objects
as.raster

Coerce to a 'raster' object
contour

Contour plot
hillShade

Hill shading
Extreme coordinates

Coordinates of the Extent of a Raster object
bind

Bind Spatial* objects
adjacent

Adjacent cells
cut

Convert values to classes
aggregate

Aggregate raster cells or SpatialPolygons/Lines
blockSize

Block size for writing files
Gain and offset

Gain and offset of values on file
as.logical

Change cell values to logical or integer values
boundaries

boundaries (edges) detection
colortable

colortable
cluster

Use a multi-core cluster
buffer

buffer
brick

Create a RasterBrick object
layerStats

Correlation and (weighted) covariance
bands

Number of bands
barplot

Bar plot of a RasterLayer
calc

Calculate
distance

Distance
cv

Coefficient of variation
hist

Histogram
compareRaster

Compare Raster objects
layerize

Layerize
cellFrom

Get cell, row, or column number
boxplot

Box plot of Raster objects
clump

Detect clumps
click

Query by clicking on a map
crop

Crop
mosaic

Merge Raster* objects using a function for overlapping areas
movingFun

Moving functions
compareCRS

Partially compare two CRS objects
hdr

Header files
extent

Extent
extension

Filename extensions
getData

Get geographic data
extremeValues

Minimum and maximum values
geom

Get the coordinates of a vector type Spatial* object
localFun

Local functions
factors

Factors
direction

Direction
extract

Extract values from Raster objects
crosstab

Cross-tabulate
getValuesFocal

Get focal raster cell values
disaggregate

Disaggregate
distanceFromPoints

Distance from points
Extract by index

Indexing to extract values of a Raster* object
pairs

Pairs plot (matrix of scatterplots)
filename

Filename
raster

Create a RasterLayer object
overlay

Overlay Raster objects
raster-package

Overview of the functions in the raster package
nlayers

Number of layers
gridDistance

Distance on a grid
head

Show the head or tail of a Raster* object
image

Image
mask

Mask values in a Raster object
filledContour

Filled contour plot
getValues

Get raster cell values
match

Value matching for Raster* objects
resample

Resample a Raster object
predict

Spatial model predictions
merge

Merge Raster* objects
initialize

Initialize a Raster object with values
rasterToContour

Raster to contour lines conversion
getValuesBlock

Get a block of raster cell values
origin

Origin
focalWeight

Focal weights matrix
projectRaster

Project a Raster object
rasterToPoints

Raster to points conversion
interpolate

Interpolate
focal

Focal values
resolution

Resolution
Programming

Helper functions for programming
inifile

Read a .ini file
metadata

Metadata
projection

Get or set a coordinate reference system (projection)
sampleRandom

Random sample
Slope and aspect

Slope and aspect
SampleInt

Sample integer values
shift

Shift
terrain

Terrain characteristics
setExtent

Set the extent of a RasterLayer
sampleRegular

Regular sample
sampleStratified

Stratified random sample
properties

Raster file properties
weighted.mean

Weighted mean of rasters
setMinMax

Compute min and max values
text

Add labels to a map
persp

Perspective plot
modal

modal value
plot

Plot a Raster* object
writeRaster

Write raster data to a file
which

Which cells are TRUE?
writeValues

Write values to a file
isLonLat

Is this longitude/latitude data?
intersect

Intersect
names

Names of raster layers
ncell

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

Global options for the raster package
rectify

rectify a Raster object
rasterTmpFile

Temporary files
rasterToPolygons

Raster to polygons conversion
rasterize

Rasterize points, lines, or polygons
plotRGB

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

Raster quantiles
rasterFromCells

Subset a raster by cell numbers
pointDistance

Distance between points
rasterFromXYZ

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

Read values from disk
reclassify

Reclassify
select

Geometric subsetting
scalebar

scalebar
replacement

Replace cell values or layers of a Raster* object
substitute

Substitute values in a Raster* object
rotated

Do the raster cells have a rotation?
rowFromCell

Row or column number from a cell number
round

Integer values
Extent math

round Extent coordinates
rotate

Rotate
subset

Subset layers in a Raster* object
stackSave

Save or open a RasterStack file
spEasy

Create SpatialLines* or SpatialPolygons*
spplot

Use spplot to plot a Raster* or other object
z-values

Get or set z-values
Summary

Summary
transpose

Transpose
trim

Trim
symdif

Symetrical difference
validCell

Validity of a cell, column or row number
shapefile

Read or write a shapefile
stackSelect

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

Scale values
stretch

Stretch
validNames

Create valid names
setValues

Set values of a Raster object
zonal

Zonal statistics
rowSums

rowSums and colSums for Raster objects
unstack

Unstack
update

Update raster cells of files (on disk)
zoom

Zoom in on a map
stackApply

Apply a function on subsets of a RasterStack or RasterBrick
unique

Unique values
xyFromCell

Coordinates from a row, column or cell number
zApply

z (time) apply
stack

Create a RasterStack object
union

Union Extent or SpatialPolygons* objects
writeFormats

File types for writing
which.min

Where is the min or max value?
KML

Write a KML or KMZ file
Extent-class

Class "Extent"
as.data.frame

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