full_days: Drop incomplete days from a dataset

full_daysR Documentation

Drop incomplete days from a dataset

Description

Drop incomplete days from a dataset

Usage

full_days(
  df,
  time_var = "Timestamp",
  drop = c("all", "leading", "trailing", "label"),
  epoch_length_sec = NULL,
  label_name = "is_full_day",
  digits = 6,
  check_continuous = TRUE,
  discontinuous_action = c("stop", "warn"),
  ...
)

Arguments

df

the input data frame

time_var

character scalar giving the column name of the variable containing timestamp information (either character or POSIXt format)

drop

character scalar indicating which incomplete days to drop. Can be all (default), leading (only day/s at the start of the file), trailing (only day/s at the end of the file), or label. If the latter is selected, the full dataset is returned with an additional column indicating whether each row of data corresponds with a complete day (useful for troubleshooting, among other things)

epoch_length_sec

optional. The epoch length of the data. If no value is passed, epoch_length_sec is invoked on the time_var column

label_name

character scalar. Name to give the indicator column when drop == "label"

digits

see epoch_length_sec

check_continuous

logical. Check the dataframe after dropping to see if it is continuous?

discontinuous_action

character scalar telling what to do if a discontinuity is expected when check_continuous = TRUE. Can be either warn (the default) or stop

...

arguments passed to as.POSIXct, for use if time_var is a character rather than POSIXt variable

See Also

df_continuous

Examples

data(ex_data, package = "PAutilities")
ex_data <- full_days(
  ex_data, "DateTime", "label", 60,
  "full_day_indicator", tz = "UTC"
)
head(ex_data)

paulhibbing/PAutilities documentation built on Sept. 12, 2022, 1:46 a.m.