mean: Arithmetic mean

Description Usage Arguments Value Examples

View source: R/calc_functions.R

Description

An extension to mean for objects of class winmove

Usage

1
2
3
4
mean(x, ...)

## S3 method for class 'winmove'
mean(x, d, type, ...)

Arguments

x

RasterLayer. The data over which to calculate the mean value within a moving window

...

further arguments passed to or from other methods

d

numeric. If type=circle, the radius of the circle (in units of the CRS). If type=rectangle the dimension of the rectangle (one or two numbers)

type

character. The shape of the moving window

Value

RasterLayer. A smoothed raster with the mean calculated within the specified moving window

Examples

1
2
3
4
5
6
7
8
# load required data
data(cont_ls)

# convert data to object of class winmove
cont_ls <- new("winmove", cont_ls)

# aggregate using a circular window with radius 3
d <- mean(cont_ls, d = 3, type = "circle")

grainchanger documentation built on Feb. 1, 2021, 5:07 p.m.