Skip to content

Instantly share code, notes, and snippets.

View walkerke's full-sized avatar

Kyle Walker walkerke

View GitHub Profile
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,
library(mapgl) # pak::pak("walkerke/mapgl")
library(tidycensus)
library(dplyr)
library(viridisLite)
# Get viridis colors
viridis_colors <- viridis(5)
# Get median household income by county in Texas
tx_income <- get_acs(
library(tidycensus)
library(mapgl)
# load_variables(2023, "acs1/profile") |> View()
births_per_1000 <- get_acs(
geography = "puma",
year = 2023,
variables = "DP02_0040",
survey = "acs5",