summary_stat: Summarize fields in 'bfastSpatial()' output

Description Usage Arguments Details Value Examples

View source: R/summary_stat.R

Description

This function manipulates the data frame produced by bfastSpatial to provide summary statistics for a specified field.

Usage

1
summary_stat(bfast_in, stat, fun1, fun2, st_date = -Inf, ed_date = Inf)

Arguments

bfast_in

A data frame generated by bfastSpatial().

stat

A character containing the name of a field in bfast_in.

fun1

A function that returns a single value and accepts an na.rm argument. This argument summarizes the values in stat by cell number.

fun2

A function that returns a single value and accepts an na.rm argument. This argument summarizes the results of the application of fun1.

st_date

A Date indicating the earliest timing of observations to include in the summary.

ed_date

A Date indicating the latest timing of observations to inclide in the summary.

Details

This function may be used for zonal statistics if combined with subset_bfast().

Value

A number that summarizes bfast_in with fun1 and fun2.

Examples

1
2
3
4
## Not run: 
summary_stat(bf_df, "brk", sum, mean)

## End(Not run)

jnghiem/bfasttools documentation built on Nov. 4, 2019, 3:02 p.m.