Skip to content

Instantly share code, notes, and snippets.

View walkerke's full-sized avatar

Kyle Walker walkerke

View GitHub Profile
# 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
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(
library(tidycensus)
library(mapgl)
tx_income <- get_acs(
geography = "tract",
variables = "B19013_001",
state = "TX",
geometry = TRUE
)
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; }
# 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)
library(mapgl)
library(tidycensus)
tarrant_age <- get_acs(
geography = "tract",
variables = "B01002_001",
state = "TX",
county = "Tarrant",
geometry = TRUE
)
library(mapgl)
library(tigris)
library(dplyr)
library(sf)
texas <- states(cb = TRUE) |>
filter(NAME == "Texas")
points <- st_sample(texas, 5000) |>
st_sfc() |>
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")
library(tidyverse)
library(tidycensus)
# Get the data
pyramid_data <- get_estimates(
geography = "state",
product = "characteristics",
breakdown = c("AGEGROUP", "SEX"),
breakdown_labels = TRUE,
vintage = 2024,