@@ -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
8686glossary <- 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 ) | >
0 commit comments