dt_aggregate.Rd
dt_aggregate()
aggregates numeric values to a specified time unit. Columns with
uniform character values are retained (i.e. patient ID, sensor name).
dt_aggregate(
df,
dt_field = NULL,
unit = "5 seconds",
floor_or_celiling = "floor",
summary_fun = "median",
na_rm_agg = TRUE
)
a data frame with a datetime field.
character; name of datetime field.
character; string specifying a time unit or a multiple of a unit to be rounded
character; either 'floor'(floor_date
)
or 'ceiling'(ceiling_date
). Default = 'floor.'
character; summary function (i.e. 'mean', 'median'). Default = 'median.'
logical; should NA values be removed before the chosen
summary_fun
computes?
a data frame aggregated by the specified time unit.
if (FALSE) {
dt_aggregate(df,
dt_field = "Date_Time",
unit = "5 seconds", floor_or_ceiling = "floor",
summary_fun = "median", na_rm_agg = TRUE
)
}