helper function for sprawl::extract_rast
used to extract
statistics of values of in_rast
for each polygon of the vector object
passed as input to extract_rast
summarize_data(in_data, rast_type, group_var, comp_quant, comp_freq, FUN,
na.rm = TRUE, band_n, selband)
Arguments
in_data |
data.table containing raster values (for a full file or a
"chunk")
|
rast_type |
character ("continuous" | "categorical) specifies if the
values passed in in_data represent a continuous or categorical variable.
(see @description)
|
group_var |
character name of the group_variable (i.e., column) to be
used as grouping group_variable for summarization. Always equal to "mdxtnq"
for now !
|
comp_quant |
logical if TRUE, percentiles of the distribution are
computed alongside standard statistics, Default: FALSE (Ignored if
rast_type == "categorical)
|
comp_freq |
logical if TRUE, frequencies of the the different classes
of a categorical raster present in each polygon are also returned,
Default = FALSE (Ignored if rast_type == "continuous")
|
FUN |
function if not NULL and is a valid function, FUN is used for
summarization and only its results are reported. Useful for example for
analyses over large high-res raster since it reduces memory footprint
(see sprawl::aggregate_rast )
|
na.rm |
logical If TRUE, nodata values are not considered in statistics
calculations for continuous variables, Default = FALSE
|
band_n |
numeric band of the original raster from which values passed
in in_data are taken.
|
selband |
character or Date bandname or acquisition data of the
band of the original raster from which values passed in in_data are taken
|
Value
data.table
containing different data as a function of rast_type
.
(See extract_rast
)