Skip to content

Commit

Permalink
update corenet for anime_join
Browse files Browse the repository at this point in the history
  • Loading branch information
wangzhao0217 committed Feb 20, 2025
1 parent bf23a24 commit 380b4f5
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 12 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ Suggests:
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
16 changes: 15 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by roxygen2: do not edit by hand

export(anime_join)
export(calculate_largest_component)
export(calculate_paths_from_point_dist)
export(coherent_network_group)
Expand All @@ -8,4 +9,17 @@ export(corenet)
export(create_coherent_network_PMtiles)
export(prepare_network)
export(removeDangles)
export(anime_join)
importFrom(anime,anime)
importFrom(anime,get_matches)
importFrom(dplyr,any_of)
importFrom(dplyr,group_by)
importFrom(dplyr,left_join)
importFrom(dplyr,mutate)
importFrom(dplyr,row_number)
importFrom(dplyr,select)
importFrom(dplyr,summarise)
importFrom(purrr,reduce)
importFrom(rlang,expr)
importFrom(rlang,sym)
importFrom(rlang,syms)
importFrom(sf,st_drop_geometry)
8 changes: 7 additions & 1 deletion R/anime_join.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ anime_join = function(
) {
# Helper to display the name of the aggregation function
get_fun_name = function(fn) {
deparse(substitute(fn))
# If the function is one of the standard ones, just return its name.
# Otherwise, you can fallback to something generic, e.g. "user-defined function".
if (identical(fn, sum)) return("sum")
if (identical(fn, mean)) return("mean")
if (identical(fn, max)) return("max")
# fallback
return("user-defined function")
}

# Let user know what's happening
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ OS_NPT_demo = cohesive_network_prep(base_network = os_edinburgh_demo_6km,
crs = "EPSG:27700",
key_attribute = "road_function",
attribute_values = c("A Road", "B Road", "Minor Road"), use_stplanr = FALSE)
# mapview::mapview(OS_NPT_demo, color = "blue") + mapview::mapview(NPT_demo_6km, color = "red")
mapview::mapview(OS_NPT_demo, zcol = "all_fastest_bicycle_go_dutch")
```
```{r}
#rename NPT_MM_OSM$geom as NPT_MM_OSM$geometry
Expand Down
63 changes: 63 additions & 0 deletions man/anime_join.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions man/calculate_paths_from_point_dist.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions man/cohesive_network_prep.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion man/corenet.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 380b4f5

Please sign in to comment.