Skip to content

Instantly share code, notes, and snippets.

View kpivert's full-sized avatar

Kurtis Pivert, MS, CAP kpivert

View GitHub Profile
@z3tt
z3tt / striptext-inside.R
Last active January 9, 2026 00:13
Place Striptext inside Facet Panels with ggplot2
library(ggplot2)
gm_2023 <- readr::read_csv("https://www.cedricscherer.com/data/gapminder-2023.csv")
pal <- c(Africa = "#00D9EE", Americas = "#4CF101", Asia = "#FF4670", Europe = "#FFE702", Oceania = "#CA4ADC")
# base plot
g <-
ggplot(gm_2023, aes(x = gdp_pcap, y = life_exp, size = pop)) +
geom_point(
color = "white",
library(shiny)
library(mapgl)
library(tidycensus)
library(bslib)
options(tigris_use_cache = TRUE)
# Get LA income data
la_income <- get_acs(
geography = "tract",
variables = "B19013_001",
# 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) # 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(
# 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(
@steveharoz
steveharoz / readme.MD
Last active April 26, 2024 09:50
Uncanny Mountain simulations
library(mapboxapi)
library(mapview)
mb_access_token("YOUR TOKEN GOES HERE")
isos <- mb_isochrone("2500 Victory Ave, Dallas TX",
time = c(5, 10, 15),
profile = "driving-traffic")
mapview(isos, zcol = "time",
@AlbertRapp
AlbertRapp / label_cleaning.R
Created February 18, 2023 14:18
3 ways to relabel data
library(tidyverse)
big_tech_companies <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2023/2023-02-07/big_tech_companies.csv')
big_tech_companies
# # A tibble: 14 × 2
# stock_symbol company
# <chr> <chr>
# 1 AAPL Apple Inc.
# 2 ADBE Adobe Inc.
# 3 AMZN Amazon.com, Inc.
# 4 CRM Salesforce, Inc.
library(tidycensus)
library(ggiraph)
library(tidyverse)
library(patchwork)
vt_income <- get_acs(
geography = "county",
variables = "B19013_001",
state = "VT",
year = 2019,
!wget --no-check-certificate \
"https://github.com/laxmimerit/dog-cat-full-dataset/archive/refs/heads/master.zip" \
-O "/tmp/cats-and-dogs.zip"
zip_ref = zipfile.ZipFile('/tmp/cats-and-dogs.zip', 'r') #Opens the zip file in read mode
zip_ref.extractall('/tmp') #Extracts the files into the /tmp folder
zip_ref.close()