This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # remotes::install_github("walkerke/mapgl") | |
| library(mapgl) | |
| # CYBERPUNK 2125 - Ultra-striking neon palette | |
| # Deep blacks + electric neons for that Blade Runner / Akira vibe | |
| cyberpunk_2125 <- c( | |
| "#000000", # Pure black (shadows) | |
| "#0a0e27", # Deep space blue (dark areas) | |
| "#1a1a2e", # Dark navy (buildings) | |
| "#16213e", # Midnight blue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(mapgl) | |
| library(sf) | |
| nc <- st_read(system.file("shape/nc.shp", package = "sf")) | |
| # Custom style with background-pattern | |
| style <- list( | |
| version = 8, | |
| sources = structure(list(), .Names = character(0)), | |
| layers = list( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidycensus) | |
| library(mapgl) | |
| tx_income <- get_acs( | |
| geography = "tract", | |
| variables = "B19013_001", | |
| state = "TX", | |
| geometry = TRUE | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(mapgl) | |
| library(shiny) | |
| library(geojsonsf) | |
| ui <- fluidPage( | |
| tags$head( | |
| tags$style(HTML( | |
| " | |
| body { margin: 0; padding: 0; } | |
| .container-fluid { padding: 0 !important; margin: 0 !important; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # DuckDB Vector Tiles with mapgl Example | |
| # This script demonstrates how to serve vector tiles from DuckDB using ST_AsMVT() | |
| # and display them in a mapgl map using httpuv | |
| library(mapgl) | |
| library(duckdb) # Requires the latest DuckDB version (>= 1.4.0) | |
| library(httpuv) | |
| library(sf) | |
| library(duckspatial) | |
| library(tigris) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(mapgl) | |
| library(tidycensus) | |
| tarrant_age <- get_acs( | |
| geography = "tract", | |
| variables = "B01002_001", | |
| state = "TX", | |
| county = "Tarrant", | |
| geometry = TRUE | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(mapgl) | |
| library(tigris) | |
| library(dplyr) | |
| library(sf) | |
| texas <- states(cb = TRUE) |> | |
| filter(NAME == "Texas") | |
| points <- st_sample(texas, 5000) |> | |
| st_sfc() |> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tigris) | |
| library(tidyverse) | |
| library(sf) | |
| library(mapgl) | |
| library(bslib) | |
| library(shiny) | |
| options(tigris_use_cache = TRUE) | |
| dfw_cbsa <- core_based_statistical_areas(cb = TRUE) |> filter(GEOID == "19100") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidyverse) | |
| library(tidycensus) | |
| # Get the data | |
| pyramid_data <- get_estimates( | |
| geography = "state", | |
| product = "characteristics", | |
| breakdown = c("AGEGROUP", "SEX"), | |
| breakdown_labels = TRUE, | |
| vintage = 2024, |
NewerOlder