guess_time_only_filter function

Try at determining which are true time only variables

Try at determining which are true time only variables

This is just a try at guessing data type based on data class and column names hoping for a tiny bit of naming consistency. R does not include a time-only data format natively, so the "hms" class from readr is used. This has to be converted to character class before REDCap upload.

guess_time_only_filter( data, validate = FALSE, sel.pos = "[Tt]i[d(me)]", sel.neg = "[Dd]at[eo]" )

Arguments

  • data: data set
  • validate: flag to output validation data. Will output list.
  • sel.pos: Positive selection regex string
  • sel.neg: Negative selection regex string

Returns

character vector or list depending on validate flag.

Examples

data <- redcapcast_data data |> guess_time_only_filter() data |> guess_time_only_filter(validate = TRUE) |> lapply(head)