Skip to content

Instantly share code, notes, and snippets.

View walkerke's full-sized avatar

Kyle Walker walkerke

View GitHub Profile
# You'll need the dev version of mapgl
# remotes::install_github("walkerke/mapgl")
library(shiny)
library(bslib)
library(mapgl)
library(tigris)
library(sf)
library(dplyr)
library(sortable)
library(tidycensus)
library(tigris)
library(tidyverse)
options(tigris_use_cache = TRUE)
# Grab the data
us_income <- get_acs(
geography = "puma",
variables = "B19013_001",
year = 2023,
# remotes::install_github("walkerke/mapgl")
library(mapgl)
library(sf)
library(dplyr)
# Set seed for reproducibility
set.seed(42)
# Define the bounding box for Dallas (approximately)
dallas_bbox <- st_bbox(c(
library(shiny)
library(bslib)
library(mapgl)
library(sf)
ui <- page_fluid(
theme = bs_theme(version = 5, bootswatch = "flatly"),
h2("mapgl Drawing Demo"),
library(mapgl)
library(tidycensus)
options(tigris_use_cache = TRUE)
tarrant_income <- get_acs(
geography = "tract",
variables = "B19013_001",
state = "TX",
county = "Tarrant",
geometry = TRUE
library(mapgl)
mapboxgl(
style = mapbox_style("streets"),
center = c(-87.61694, 41.86625),
zoom = 15.99,
pitch = 40,
bearing = 20,
antialias = TRUE
) |>
library(mapgl)
maplibre(
style = maptiler_style("bright"),
center = c(-118.705, 34.027),
zoom = 10
) |>
add_symbol_layer(
id = "trailheads",
source = list(
library(mapgl)
mapboxgl(
style = mapbox_style("satellite"),
center = c(-122.514426, 37.562984),
zoom = 17,
bearing = -96,
minZoom = 14
) |>
add_video_source(
library(tigris)
library(mapgl)
options(tigris_use_cache = TRUE)
tarrant = tracts("TX", "Tarrant", cb = TRUE)
mapboxgl(style = mapbox_style("light")) |>
fit_bounds(tarrant, pitch = 75) |>
add_fill_extrusion_layer(
id = "tracts",
library(tidycensus)
library(tigris)
library(tidyverse)
library(sf)
library(ggiraph)
library(patchwork)
options(tigris_use_cache = TRUE)
set.seed(123456)
# Get a list of counties within the Austin CBSA using tigris