Learn R Programming

fieldRS (version 0.2.3)

relative.freq: relative.freq

Description

Estimate the relative frequency of non-NA pixels.

Usage

relative.freq(x, na.rm = TRUE)

Arguments

x

A vector of class numeric or an object of class rasterLayer.

na.rm

Logical. Should the NA values be excluded. Default is TRUE.

Value

A numeric element or an object of class RasterLayer.

Details

Estimates the relative frequency of non-NA values.

See Also

mape

Examples

Run this code
# NOT RUN {
{

x <- c(1, 1, 1, NA, NA, 1, NA)
f <- relative.freq(x, na.rm=TRUE)

}
# }

Run the code above in your browser using DataLab