Skip to content

Commit

Permalink
new time variable names in eurostat dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
antaldaniel committed Dec 23, 2023
1 parent 9f4cca1 commit 8bc346c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions R/globals.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ utils::globalVariables(c(
"iotables_label", # <employment_get>
"values", # <employment_get>
".data", # <iotable_get>
"TIME_PERIOD_lab", # <iotables_download>
"values_lab", # <iotables_download>
"time_lab", # <iotables_download>
"TIME_PERIOD", # <iotables_download>
"uk_col", # <order_iotable>
"uk_row", # <order_iotable>
"row_order", # <order_iotable>
Expand Down
4 changes: 3 additions & 1 deletion R/iotables_download.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ iotables_download <- function ( source = "naio_10_cp1700",

downloaded_labelled <- downloaded_labelled %>% # add meaningful labels to raw data
rlang::set_names(lab_names) %>%
rename ( time_lab = TIME_PERIOD_lab ) %>%
mutate ( rows = seq_len(nrow(downloaded)) ) %>% # because long and wide formats are not symmetric
rename ( values = values_lab ) %>%
mutate ( year = lubridate::year(time_lab))
Expand All @@ -96,7 +97,8 @@ iotables_download <- function ( source = "naio_10_cp1700",

downloaded <- downloaded %>%
mutate ( rows = seq_len(nrow(downloaded)) ) %>%
left_join ( downloaded_labelled, by = c("rows", "values"))
left_join ( downloaded_labelled, by = c("rows", "values")) %>%
rename ( time = TIME_PERIOD )

names(downloaded)

Expand Down

0 comments on commit 8bc346c

Please sign in to comment.