Skip to content

Commit d8d6233

Browse files
committed
Housekeeping
1 parent 841c1ef commit d8d6233

8 files changed

Lines changed: 29 additions & 36 deletions

File tree

data-raw/data-raw.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## Get up-to-date stations data
2-
stations_dl_internal(verbose = TRUE)
2+
withr::with_options(list("weathercan.verbosity" = "verbose"), {
3+
stations_dl_internal()
4+
})
35

46
kamloops_day <- weather_dl(
57
51423,

data-raw/metadata.R

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ gloss_url <- tibble(interval = names(gloss_url), data = gloss_url) |>
8080
mutate(
8181
value = paste0("https://climate.weather.gc.ca/glossary_e.html#", values)
8282
) |>
83-
select("interval", "weathercan_name" = "ind", "ECCC_ref" = "value")
83+
select("interval", "weathercan" = "ind", "ECCC_ref" = "value")
8484

8585

8686
glossary <- tibble(
@@ -89,43 +89,43 @@ glossary <- tibble(
8989
rep("day", length(w_names$day)),
9090
rep("month", length(w_names$month))
9191
),
92-
ECCC_name = unlist(w_names, use.names = FALSE),
93-
weathercan_name = names(unlist(c(w_names, use.names = FALSE))),
94-
units = str_replace_all(str_extract(ECCC_name, "\\(.*\\)"), "\\(|\\)", "")
92+
ECCC = unlist(w_names, use.names = FALSE),
93+
weathercan = names(unlist(c(w_names, use.names = FALSE))),
94+
units = str_replace_all(str_extract(ECCC, "\\(.*\\)"), "\\(|\\)", "")
9595
) |>
96-
left_join(gloss_url, by = c("interval", "weathercan_name")) |>
96+
left_join(gloss_url, by = c("interval", "weathercan")) |>
9797
mutate(
9898
ECCC_ref = replace(
9999
ECCC_ref,
100-
weathercan_name == "qual",
100+
weathercan == "qual",
101101
"https://climate.weather.gc.ca/climate_data/data_quality_e.html"
102102
),
103103
ECCC_ref = replace(
104104
ECCC_ref,
105-
str_detect(weathercan_name, "_flag"),
105+
str_detect(weathercan, "_flag"),
106106
"See `flags` vignette or dataset for more details"
107107
),
108108
ECCC_ref = replace(ECCC_ref, str_detect(ECCC_ref, "#NA"), NA),
109109
units = replace(
110110
units,
111-
weathercan_name %in% c("year", "month", "day", "hour"),
112-
weathercan_name[weathercan_name %in% c("year", "month", "day", "hour")]
111+
weathercan %in% c("year", "month", "day", "hour"),
112+
weathercan[weathercan %in% c("year", "month", "day", "hour")]
113113
),
114114
ECCC_ref = replace(
115115
ECCC_ref,
116-
weathercan_name %in% c("year", "month", "day", "hour"),
116+
weathercan %in% c("year", "month", "day", "hour"),
117117
"https://climate.weather.gc.ca/glossary_e.html#dataInt"
118118
),
119-
units = replace(units, weathercan_name == "time", "ISO date/time"),
120-
units = replace(units, weathercan_name == "date", "ISO date"),
119+
units = replace(units, weathercan == "time", "ISO date/time"),
120+
units = replace(units, weathercan == "date", "ISO date"),
121121
units = replace(
122122
units,
123-
weathercan_name %in% c("hmdx", "wind_chill"),
123+
weathercan %in% c("hmdx", "wind_chill"),
124124
"index"
125125
),
126126
units = replace(
127127
units,
128-
str_detect(weathercan_name, c("(qual)|(_flag)|(weather)")),
128+
str_detect(weathercan, c("(qual)|(_flag)|(weather)")),
129129
"note"
130130
)
131131
) |>

data/glossary.rda

-8 Bytes
Binary file not shown.

data/variables_normals_old.rda

151 Bytes
Binary file not shown.

inst/extdata/stations.rds

7 Bytes
Binary file not shown.

man/normals_dl.Rd

Lines changed: 3 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/variables_normals_new.Rd

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/weather_dl.Rd

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)