Creates a date column set to the first day of the survey month and inserts it immediately after the survey month column. Works on both unlabelled tables (columns `SURVYEAR` / `SURVMNTH`, date column named `SURVDATE`) and labelled tables produced by [label_pumf_columns()] (columns `"Survey year"` / `"Survey month"`, date column named `"Survey date"`).
Examples
if (FALSE) { # \dontrun{
# Unlabelled
lfs <- get_pumf("LFS", "2023")
lfs |> add_lfs_SURVDATE() |> dplyr::select(SURVYEAR, SURVMNTH, SURVDATE) |>
dplyr::distinct() |> dplyr::collect()
# Labelled
lfs |> label_pumf_columns() |> add_lfs_SURVDATE() |>
dplyr::select(`Survey year`, `Survey month`, `Survey date`) |>
dplyr::distinct() |> dplyr::collect()
close_pumf(lfs)
} # }
