Skip to contents

Convert and update the date values

Usage

date_convert_and_update(
  data,
  timeframe,
  new_dates,
  cols,
  error_tolerance = 0.5
)

Arguments

data

A data frame or linelist

timeframe

A vector of 2 values of type date. If provided, date values that do not fall within this timeframe will be set to NA.

new_dates

A vector of the converted date values

cols

The names of the date column been converted

error_tolerance

A number between 0 and 1 indicating the proportion of entries which cannot be identified as dates to be tolerated; if this proportion is exceeded, the original vector is returned, and a message is issued; defaults to 0.4 (40 percent).

Value

A list of 2 data frames: the updated input data (if some columns were converted to Date) and a data frame of date values that are not within the specified timeframe.