ggplot() +geom_sf(aes(fill = worker), data = region_w) +scale_fill_gradient(low ='white', high ='blue', trans ='log10') +facet_wrap(vars(gender_name)) +theme_bw()
次に、佐賀市・久留米市への通勤者数による塗り分け地図を作ってみましょう。
region_c <- region |>left_join(commuter, by =join_by(origin_code))glimpse(region_c)
region_d <- region |>left_join(worker, by =join_by(origin_code)) |>left_join(commuter, by =join_by(origin_code, gender_name)) |>left_join(distance, by =join_by(origin_code, destination_name)) |>mutate(rate = commuter / worker)glimpse(region_d)