forked from PierreMasselot/RiskExtrapolation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA1_DataDesc.R
More file actions
24 lines (21 loc) · 895 Bytes
/
A1_DataDesc.R
File metadata and controls
24 lines (21 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
################################################################################
#
# Appendix 1.
# Data description
#
################################################################################
#-----------------------
# List of cities
#-----------------------
# Select variables, sort, transform and rename
city_desc <- metadf |>
subset(select = c(city_code, city_name, geozone, obs, pop, tmean)) |>
arrange(city_code) |>
mutate(obs = factor(obs, levels = c(T, F), labels = c("Yes", "No")),
pop = formatC(pop, format = "f", big.mark = ",", digits = 0),
tmean = formatC(tmean, format = "f", digits = 1)) |>
rename(`Eurostat code` = "city_code", Name = "city_name", Region = "geozone",
Observed = "obs", Population = "pop", `Mean temperature` = "tmean")
# Export
write.table(city_desc, file = "figures/TableS1_citydesc.txt", sep = ";",
quote = F, row.names = F)