diff --git a/code/tests/paper_table.R b/code/tests/paper_table.R index 9f3e187..10dbe1d 100644 --- a/code/tests/paper_table.R +++ b/code/tests/paper_table.R @@ -1,15 +1,51 @@ library(tidyverse) library(sf) +library(tmap) +tmap_mode("view") sites_join = sf::read_sf("data-small/all-sites.geojson") # remove sites with less than 500 dwellings at completion -sites_join = sites_join %>% +sites_table_geo = sites_join %>% filter(dwellings_when_complete >= 500) -sites_table = sites_join %>% - st_drop_geometry() %>% +sites_table_geo %>% + skimr::skim() +sites_table_point = sf::st_centroid(sites_table_geo) +# works but no legend: +tm_shape(sites_table_point) + + tm_dots(size = "dwellings_when_complete") + +regions = sf::read_sf("https://github.com/saferactive/saferactive/releases/download/0.1.4/Regions_.December_2020._EN_BGC.geojson") +regions_simplified = rmapshaper::ms_simplify(regions, keep = 0.01) +# gb_outline = sf::read_sf("https://github.com/martinjc/UK-GeoJSON/raw/master/json/administrative/gb/lad.json") +regions_linestrings = sf::st_cast(regions_simplified, to = "MULTILINESTRING") +gb_outline = rnaturalearth::ne_countries(country = "United Kingdom", scale = "medium", returnclass = "sf") +gb_outline_linestrings = sf::st_cast(gb_outline, to = "MULTILINESTRING") +regions_buffered = sf::st_difference( + regions_linestrings, + sf::st_buffer(gb_outline_linestrings, 1000) +) +tmap_mode("plot") +# tmaptools::palette_explorer() +tmap_options(check.and.fix = TRUE) +tm_shape(regions_buffered) + + tm_lines(col = "grey", lwd = 0.5) + + tm_shape(sites_table_point) + + tm_dots( + "percent_commute_active_base", size = "dwellings_when_complete", title = "% Active", title.size = "Dwellings", + palette = "plasma", legend.size.is.portrait = TRUE) + + tm_shape(gb_outline) + + tm_borders(lwd = 2) + + tm_layout(legend.position = c(0.8, 0.67), scale = 1.5) + + tm_scale_bar() + + tm_compass(position = c("right", "top")) + +sites_table = sites_table_geo %>% select(percent_commute_active_base, percent_commute_walk_base, percent_commute_cycle_base, percent_commute_drive_base, circuity_fast_cycle, circuity_walk, busyness_fast_cycle, median_commute_distance, distance_to_town, percent_commute_active_scenario, percent_commute_walk_scenario, percent_commute_cycle_scenario, percent_commute_drive_scenario, in_site_walk_circuity, in_site_cycle_circuity, in_site_drive_circuity) +st_drop_geometry() + + sites_table$in_site_walk_circuity = as.numeric(sites_table$in_site_walk_circuity) sites_table$in_site_cycle_circuity = as.numeric(sites_table$in_site_cycle_circuity) diff --git a/figures/app-size.png b/figures/app-size.png new file mode 100644 index 0000000..95be48f Binary files /dev/null and b/figures/app-size.png differ diff --git a/figures/large-apps.png b/figures/large-apps.png new file mode 100644 index 0000000..4a8a086 Binary files /dev/null and b/figures/large-apps.png differ diff --git a/figures/lcid-v-wide-image.png b/figures/lcid-v-wide-image.png new file mode 100644 index 0000000..168ad63 Binary files /dev/null and b/figures/lcid-v-wide-image.png differ diff --git a/figures/lcid-v-wide-image2.png b/figures/lcid-v-wide-image2.png new file mode 100644 index 0000000..514d646 Binary files /dev/null and b/figures/lcid-v-wide-image2.png differ diff --git a/figures/lcid-v-wide-image3.png b/figures/lcid-v-wide-image3.png new file mode 100644 index 0000000..ae80f45 Binary files /dev/null and b/figures/lcid-v-wide-image3.png differ diff --git a/figures/lcid-wide-image.png b/figures/lcid-wide-image.png new file mode 100644 index 0000000..3c9da07 Binary files /dev/null and b/figures/lcid-wide-image.png differ diff --git a/figures/logo.kra b/figures/logo.kra new file mode 100644 index 0000000..11528de Binary files /dev/null and b/figures/logo.kra differ diff --git a/figures/logo.png b/figures/logo.png new file mode 100644 index 0000000..6e1ca5e Binary files /dev/null and b/figures/logo.png differ