From a9114d8007a85edb4a7c2727f6a4c89fb00126ad Mon Sep 17 00:00:00 2001 From: RFlx Date: Wed, 3 Apr 2024 17:48:50 +0100 Subject: [PATCH] entropy done #6 closes #7 --- R/functions.R | 4 ++-- _targets.R | 6 ++---- _targets/meta/meta | 5 +++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/R/functions.R b/R/functions.R index 11f5ac9..e8d0b4c 100644 --- a/R/functions.R +++ b/R/functions.R @@ -344,7 +344,7 @@ get_landuse = function(grid, CITYcensus) { find_candidates = function(grid, centrality_grid, density_grid, CITY, population_min, degree_min, betweeness_range, closeness_range, - landuse_entropy) { + entropy_min, landuse_entropy) { # centrality candidates_centrality = grid |> @@ -380,7 +380,7 @@ find_candidates = function(grid, centrality_grid, density_grid, CITY, landuse_entropy = readRDS("outputdata/test_landuse_entropy.Rds") # WHY does not work without this?? candidates_landuse = landuse_entropy |> - dplyr::filter(entropy >= 0.35) + dplyr::filter(entropy >= entropy_min) st_write(candidates_landuse, paste0("outputdata/", CITY, "/candidates_landuse.gpkg"), delete_dsn = TRUE) diff --git a/_targets.R b/_targets.R index 2064c5f..512bbe4 100644 --- a/_targets.R +++ b/_targets.R @@ -15,6 +15,7 @@ population_min = mean # mean or median? default: mean degree_min = mean # mean or median? default: mean betweeness_range = 0.4 # percentile to exclude (upper and lower) default: 0.25 closeness_range = 0.25 # value to exclude (upper and lower) default: 0.25 +entropy_min = 0.35 # value to exclude (lower) default: 0.5 ######################################### @@ -90,14 +91,11 @@ list( tar_target( name = landuse_entropy, command = get_landuse(grid, CITYcensus)), - # tar_target( - # name = landuse_grid, - # command = get_landuse_grid(landuse_entropy, grid, CITY)), tar_target( name = candidates_all, command = find_candidates(grid, centrality_grid, density_grid, CITY, population_min, degree_min, betweeness_range, closeness_range, - landuse_entropy) + entropy_min, landuse_entropy) ) ) diff --git a/_targets/meta/meta b/_targets/meta/meta index a47b7f5..c035f4e 100644 --- a/_targets/meta/meta +++ b/_targets/meta/meta @@ -2,7 +2,7 @@ name|type|data|command|depend|seed|path|time|size|bytes|format|repository|iterat betweeness_range|object|6143dec821aabc67||||||||||||||| build_osm|object|df161ddba3dacc9e||||||||||||||| candidates|function|9c2f95a20efa2e79||||||||||||||| -candidates_all|stem|af263fd9086f3b5e|116a11b16fc3cfca|ec0d9536ed09fbe5|392372375||t19816.6686064083s|3eca82e267962690|1462|rds|local|vector|||0.076|| +candidates_all|stem|af263fd9086f3b5e|20e287d5c6f223d2|d642bc64d6b8cf0d|392372375||t19816.6916486058s|3eca82e267962690|1462|rds|local|vector|||0.087|| candidates_centrality|stem|9c82654c90976b49|beb5619abcee056e|26e2e18e51069a1d|-1085204634||t19775.8090717049s|c197b53c03af64b3|5712|rds|local|vector|||0.037|| cellsize_input|object|4ff1951c78c41c6c||||||||||||||| CENSUScity|stem|ef9abd6614a38b8b|748a76bf12cc97b3|0e5e9788954ad081|329073188||t19779.597953638s|545e975dd6f9c10f|41524|rds|local|vector|||12.765|| @@ -16,7 +16,8 @@ clean_osm|function|f99826f41b1a7176||||||||||||||| closeness_range|object|8a0059b814463716||||||||||||||| degree_min|function|138cee1ae58dbe3f||||||||||||||| density_grid|stem|9bb228bac6b054a7|2199969ee386be70|a4ae85b485b1cab4|-6812704||t19816.6684728425s|d19d745e57a15b0c|2446|rds|local|vector|||0.048|| -find_candidates|function|ff0e0ad978477650||||||||||||||| +entropy_min|object|094c5052fd9b1fc9||||||||||||||| +find_candidates|function|e9be8befa5f63af5||||||||||||||| get_census|function|d740e0d975dc3860||||||||||||||| get_centrality|function|0089e1e79e20a390||||||||||||||| get_centrality_grid|function|ea22a409243f2eb5|||||||||||||||