Find the date of the last observation (NAs are dropped)
find_end.Rd
Find the date of the last observation (NAs are dropped)
Examples
quarterly_data_example |>
dplyr::mutate(E_NF_HI = dplyr::if_else(time > "2022-01-01", NA_real_, E_NF_HI)) |>
find_end()
#> [1] "2022-01-01" "2025-01-01" "2025-01-01" "2025-01-01" "2025-01-01"
#> [6] "2025-01-01" "2025-01-01" "2025-01-01" "2025-01-01" "2025-01-01"
#> [11] "2025-01-01" "2025-01-01" "2025-01-01" "2025-01-01" "2025-01-01"
#> [16] "2025-01-01" "2025-01-01" "2025-01-01" "2025-01-01" "2025-01-01"
#> [21] "2025-01-01" "2025-01-01" "2025-01-01" "2025-01-01" "2025-01-01"
#> [26] "2025-01-01" "2025-01-01" "2025-01-01" "2025-01-01" "2025-01-01"
quarterly_data_example |>
dplyr::mutate(E_NF_HI = dplyr::if_else(time > "2022-01-01", NA_real_, E_NF_HI)) |>
find_end(TRUE)
#> [1] "2022-03-31" "2025-03-31" "2025-03-31" "2025-03-31" "2025-03-31"
#> [6] "2025-03-31" "2025-03-31" "2025-03-31" "2025-03-31" "2025-03-31"
#> [11] "2025-03-31" "2025-03-31" "2025-03-31" "2025-03-31" "2025-03-31"
#> [16] "2025-03-31" "2025-03-31" "2025-03-31" "2025-03-31" "2025-03-31"
#> [21] "2025-03-31" "2025-03-31" "2025-03-31" "2025-03-31" "2025-03-31"
#> [26] "2025-03-31" "2025-03-31" "2025-03-31" "2025-03-31" "2025-03-31"