Skip to contents

Propegate field missingness from higher to lower resolution

Usage

propagate_na(x, keep_tz = FALSE)

Arguments

x

a vector of parttime objects with days which may exceed viable days of month

keep_tz

logical indicating whether to retain timezone fields, even if other fields are missing

Value

a partial_time vector with missingness propagated to lower resolution time fields

Examples

x <- as.parttime(c("2019", "2019-02-31", "2019-01-05", "2016-02-31",
  "2016-01-05", "2020-01-01 03:04:05.1234"))
vctrs::field(x, "pttm_mat")[,"min"] <- 23
parttime:::propagate_na(x)
#> <partial_time<YMDhms+tz>[6]> 
#> [1] "2019"                    "2019-02-31"             
#> [3] "2019-01-05"              "2016-02-31"             
#> [5] "2016-01-05"              "2020-01-01 03:23:05.123"