hexGreenSpace {greenR} | R Documentation |
Visualize Green Space Coverage with Hexagonal Bins
Description
Creates a hexagonal binning map to visualize the percentage of green space coverage within a specified area. Users can customize the hexagon size, color palette, and other map features.
Usage
hexGreenSpace(
green_areas_data = NULL,
tree_data = NULL,
hex_size = 500,
color_palette = "viridis",
save_path = NULL
)
Arguments
green_areas_data |
List containing green areas data (obtained from the |
tree_data |
List containing tree data (obtained from the |
hex_size |
Numeric, size of the hexagons in meters, default is 500. |
color_palette |
Character, name of the color palette to use, default is "viridis". |
save_path |
Character, file path to save the map as an HTML file, default is NULL (do not save). |
Value
A list containing a Leaflet map displaying the percentage of green space coverage, and a ggplot2 violin plot.
Examples
## Not run:
data <- get_osm_data("City of London, United Kingdom")
green_areas_data <- data$green_areas
tree_data <- data$trees
hex_map <- hexGreenSpace(green_areas_data, tree_data, hex_size = 300)
print(hex_map$map) # Display the hex bin map
print(hex_map$violin) # Display the violin plot
## End(Not run)
[Package greenR version 0.0.1.3 Index]