Description Usage Arguments Details Value
View source: R/getGroupValue.R
This function uses the group_by()
functions from the dplyr package and applies the with_ties = FALSE option to retain only one record per group. The group column can be a date object, an integer, or character variable to group by.
1 2 3 4 5 6 7 | getGroupValue(
df,
groupColumn,
valueColumn,
value = "max",
dateGroup = "noDate"
)
|
df |
A data.frame or tibble data object including a date and value column |
groupColumn |
The column name, character or integer, of the group column. Can be a blocking variable representing sites, dates, or other groups. If using complete dates (year, month, day present) ensure as.date format yyyy-mm-dd. Incomplete dates (i.e. only years) should remain as integers. |
valueColumn |
The column name, character or integer, of the data values to be tested. |
value |
The value to be returned, either "min", "max", "mean", or "median. |
dateGroup |
If using a date formatted groupColumn, specify whether grouping by "year", "month", or "day". |
Identify and retain only max or min value from grouped data
A data.frame of test results: number of points and high and low confidence intervals. One row per dataframe in the provided list.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.