Skip to content

Commit

Permalink
entropy done
Browse files Browse the repository at this point in the history
#6
closes #7
  • Loading branch information
temospena committed Apr 3, 2024
1 parent 8e623e7 commit a9114d8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions R/functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 |>
Expand Down Expand Up @@ -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)

Expand Down
6 changes: 2 additions & 4 deletions _targets.R
Original file line number Diff line number Diff line change
Expand Up @@ -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

#########################################

Expand Down Expand Up @@ -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)
)
)

5 changes: 3 additions & 2 deletions _targets/meta/meta
Original file line number Diff line number Diff line change
Expand Up @@ -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||
Expand All @@ -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|||||||||||||||
Expand Down

0 comments on commit a9114d8

Please sign in to comment.