Wrapper function to calculate terrain analysis statistics for a RasterStack

get_stats_df(
  fun,
  fun_name,
  ls,
  dem_file,
  lines = NULL,
  stat = c(median, mean, min, max, sd, e1071::skewness),
  stat_name = c("median", "mean", "min", "max", "sd", "skew")
)

Arguments

fun

either near_channel_stats or raster_stats

fun_name

a character string specifying the name of the function in the column of the resulting data.frame

ls

a RasterStack of terrain analysis rasters

dem_file

character, DEM filename (used for fixing names)

lines

a SpatialLinesDataFrame

stat

functions, list of statistics to derive

stat_name

character, labels corresponding to stat

Value

a data.frame with the values for the requested terrain analysis distribution metrics