mean_slope: Calculates the mean slope to the horizon

View source: R/radiationtools.R

mean_slopeR Documentation

Calculates the mean slope to the horizon

Description

mean_slope is used to calculates the mean slope to the horizon in all directions.

Usage

mean_slope(dtm, steps = 36, reso = 1)

Arguments

dtm

a raster object, two-dimensional array or matrix of elevations (m).

steps

an optional integer. The mean slope is calculated from the horizon angle in specified directions. Steps defines the total number of directions used. If the default 36 is specified, then the horizon angle is calculated at 10º intervals.

reso

a single numeric value representing the spatial resolution of dtm (m).

Details

If dtm is a raster object, a raster object is returned. The projection system associated with dtm must be such that units of x, y and z are identical. Use projectRaster() to convert the projection to a Universal Transverse Mercator type projection system.

Value

a raster object or a two-dimensional array of the mean slope angle to the horizon in all directions (º).

Examples

library(raster)
ms <- mean_slope(dtm100m, reso = 100)
plot(ms, main = "Mean slope to horizon")

ilyamaclean/microclima documentation built on Oct. 31, 2023, 11:41 p.m.