Skip to contents

Fixes heaping errors in time series. The structure of this function was taken from the function find_heap_and_deheap created by Kevin Zhao (https://github.com/davidearn/KevinZhao/blob/main/Report/make_SF_RData.R). This needs to be better documented.

Usage

Deheaper(
  prefix = "deheaped_",
  first_date = "1830-01-01",
  last_date = "1841-12-31",
  week_start = 45,
  week_end = 5,
  deheaping_scale = 2.7
)

Arguments

first_date

string containing earliest date to look for heaping errors

last_date

string containing last date to look for heaping errors

week_start

numeric value of the first week number to start looking for heaping errors

week_end

numeric value of the last week number to look for heaping errors

Value

A function like deheaper_default to fix heaping errors.