View source: R/rvn_utilities.R
cmax | R Documentation |
Applies the base::max function across columns.
cmax(x, na.rm = FALSE)
x |
object to apply the max function to |
na.rm |
whether to remove na values from the calculation |
It applies the base::max function over columns, which is advantageous for calculating the max within a column rather than the max of the whole data frame. The default base::max will not work properly for data frames and other structures in applying over columns or different periods.
This function was included for usage with the apply.<period> and rvn_apply_wyearly
function, as the base::max function does not work properly across columns.
x with the max value in each column determined
rvn_apply_wyearly
where this function can be applied for the water year,
and the xts functions such as apply.yearly
and apply.monthly
data(rvn_hydrograph_data)
cmax(rvn_hydrograph_data$hyd$Sub43_obs, na.rm=TRUE)
rvn_apply_wyearly(rvn_hydrograph_data$hyd, cmax, na.rm=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.