catch_stats | R Documentation |
Calculate full catchment statistics by summing field(s) value(s) for all upstream catchments
catch_stats(sitelist, hierarchy, subcatchment.data, FUN, ...)
sitelist |
a vector of sites for which compiled statistics are to be calculated. |
hierarchy |
a dataframe containing catchment id and next downstream (nextds) id fields. |
subcatchment.data |
a vector or dataframe containing variables for which statistics are sought. |
FUN |
an unquoted scalar function used to summarise each field (e.g. min, mean, max). |
... |
further arguments passed to or from other methods. |
a vector or dataframe of aggregate values
function to calculate full catchment statistics by summing each field of the table (or vector) subcatchment.data (length = no. of rows in hierarchy) For each site in sitelist, statistics as per scalar function FUN for all upstream catchments are deriveded using hierarchy in the function allupstream.
data(mwcats)
catch_stats(sitelist=mwcats$site[1:5], hierarchy = mwcats[,c(1:2)],
subcatchment.data=mwcats$scstrlen, FUN=sum)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.