From cc4eb05f17eded1fd3a8ee6fdb1b8e23cd49ada7 Mon Sep 17 00:00:00 2001 From: Fran Barton Date: Thu, 12 Oct 2023 22:24:45 +0100 Subject: [PATCH] Fixes to data processing --- R/postcode_data_join_helpers.R | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/R/postcode_data_join_helpers.R b/R/postcode_data_join_helpers.R index e94c0bc..639ea3e 100644 --- a/R/postcode_data_join_helpers.R +++ b/R/postcode_data_join_helpers.R @@ -49,13 +49,13 @@ bulk_reverse_geocode <- function(.data) { unnest_codes <- function(.data) { .data |> - dplyr::mutate( - codes_names = names(codes), - across("codes", unlist)) |> + dplyr::mutate(codes_names = names(codes)) |> + dplyr::mutate(across("codes", unlist)) |> + dplyr::rename(code = "codes") |> tidyr::pivot_wider( - names_from = codes_names, + names_from = "codes_names", names_glue = "{codes_names}_{.value}", - values_from = codes) + values_from = "code") }