From 60321fd80c45e1c39a8e9449a427044fe4e67105 Mon Sep 17 00:00:00 2001 From: temospena Date: Sun, 25 Feb 2024 23:13:01 +0000 Subject: [PATCH] rescale population ? @valenca13 which math should we do regarding the absolute values of sum(population) in each cell? --- code/population.R | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/population.R b/code/population.R index 907e753..6086693 100644 --- a/code/population.R +++ b/code/population.R @@ -36,7 +36,12 @@ population_grid = join = st_intersects) %>% st_drop_geometry() %>% group_by(ID) %>% - summarise(population = sum(N_INDIVIDUOS)) + summarise(population = sum(N_INDIVIDUOS)) |> + mutate(population = scales::rescale(population)) #? + +# table(population_grid$population > 0.5) +# FALSE TRUE +# 1044 25 population_grid_geo = GRID |> left_join(population_grid) mapview::mapview(population_grid_geo, zcol="population") + mapview::mapview(CENSUScity)