Learn R Programming

velox (version 0.2.0)

VeloxRaster_aggregate: Aggregate

Description

Aggregates a VeloxRaster object to a lower resolution.

Arguments

factor

A numeric vector of length 1 or 2 indicating the aggregation factor in the x and y dimensions. Must be positive integers > 1.

aggtype

A character string indicating the aggregation type. See Details.

Value

Void.

Details

aggtype must be one of the following: "sum", "mean", "min", "max", "median".

Examples

Run this code
# NOT RUN {
## Make VeloxRaster
mat <- matrix(1:100, 10, 10)
vx <- velox(mat, extent=c(0,1,0,1), res=c(0.1,0.1), crs="+proj=longlat +datum=WGS84 +no_defs")
## Aggregate
vx$aggregate(factor=c(2,2), aggtype='sum')
# }

Run the code above in your browser using DataLab