Skip to content

Commit 1856910

Browse files
committed
stick with wcde-v3 - dont allow wcde-v31, wcde-v30
1 parent f467af5 commit 1856910

File tree

5 files changed

+29
-3
lines changed

5 files changed

+29
-3
lines changed

R/get_wcde.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#' @param pop_edu Character string for population educational attainment if `indicator` is set to `pop`. Defaults to `total`, but can be set to `four`, `six` or `eight`.
1212
#' @param include_scenario_names Logical vector of length one to indicate if to include additional columns for scenario names and short names. `FALSE` by default.
1313
#' @param server Character string for server to download from. Defaults to `iiasa`, but can use `github` or `1&1` if IIASA server is down. Can check availability by setting to `search-available`.
14-
#' @param version Character string for version of projections to obtain. Defaults to `wcde-v3`, but can use `wcde-v2` or `wcde-v1`. Scenario and indicator availability vary between versions.
14+
#' @param version Character string for version of projections to obtain. Defaults to `wcde-v31`, but can use `wcde-v2` or `wcde-v1`. Scenario and indicator availability vary between versions.
1515
#'
1616
#' @details If no `country_name` or `country_code` is provided data for all countries and regions are downloaded. A full list of available countries and regions can be found in the `wic_locations` data frame.
1717
#'
@@ -123,6 +123,8 @@ get_wcde <- function(
123123
country_code <- c(country_code, guessed_code)
124124

125125
version <- match.arg(version)
126+
# if(version == "wcde-v3")
127+
# version <- "wcde-v31"
126128

127129
if(indicator == "pop"){
128130
pop_age <- match.arg(pop_age)

data-raw/wic_indicators.R

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ x <- dir_ls("./data-raw", type = "directory") %>%
1414
description = 2) %>%
1515
mutate_if(is.numeric, as.logical)
1616

17+
# x0 <- x %>%
18+
# filter(version == "wcde-v3") %>%
19+
# mutate(version = "wcde-v30")
20+
#
21+
# x1 <- x %>%
22+
# filter(version == "wcde-v3") %>%
23+
# mutate(version = "wcde-v31")
24+
#
25+
# x <- x %>%
26+
# bind_rows(x0) %>%
27+
# bind_rows(x1)
28+
1729
# latest definition - to many edits which messes up pivot wider later on
1830
d <- x %>%
1931
arrange(version) %>%
@@ -36,7 +48,10 @@ wic_indicators <- x %>%
3648
relocate(1, 2, contains("wcde")) %>%
3749
rename(wcde_v1 = `wcde-v1`,
3850
wcde_v2 = `wcde-v2`,
39-
wcde_v3 = `wcde-v3`) %>%
51+
wcde_v3 = `wcde-v3`,
52+
# wcde_v30 = `wcde-v30`,
53+
# wcde_v31 = `wcde-v31`
54+
) %>%
4055
mutate(
4156
wcde_v1 = case_when(
4257
wcde_v1 == FALSE ~ "projection-only",
@@ -49,7 +64,15 @@ wic_indicators <- x %>%
4964
wcde_v3 = case_when(
5065
wcde_v3 == FALSE ~ "projection-only",
5166
wcde_v3 == TRUE ~ "past-available",
52-
)
67+
),
68+
# wcde_v30 = case_when(
69+
# wcde_v30 == FALSE ~ "projection-only",
70+
# wcde_v30 == TRUE ~ "past-available",
71+
# ),
72+
# wcde_v31 = case_when(
73+
# wcde_v31 == FALSE ~ "projection-only",
74+
# wcde_v31 == TRUE ~ "past-available",
75+
# )
5376
) %>%
5477
rename("wcde-v1" = wcde_v1,
5578
"wcde-v2" = wcde_v2,

data/wic_indicators.rda

15 Bytes
Binary file not shown.

data/wic_scenarios.rda

4 Bytes
Binary file not shown.

wcde.Rproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Version: 1.0
2+
ProjectId: 5007d75c-9231-421a-9ca0-6933d661f5b4
23

34
RestoreWorkspace: No
45
SaveWorkspace: No

0 commit comments

Comments
 (0)