Skip to content

Instantly share code, notes, and snippets.

@han-tun
han-tun / step_by_step_loop.ipynb
Created March 27, 2025 17:17 — forked from acstrahl/step_by_step_loop.ipynb
Dataquest Project Lab Walkthrough: Word Raider
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sparkline Line =
// Static line color - use %23 instead of # for Firefox compatibility
VAR LineColor = "%2301B8AA"
// "Date" field used in this example along the X axis
VAR XMinDate = MIN('Table'[Date])
VAR XMaxDate = MAX('Table'[Date])
// Obtain overall min and overall max measure values when evaluated for each date
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)
# remotes::install_github("walkerke/mapgl")
library(mapgl)
options(tigris_use_cache = TRUE)
tarrant = tracts("TX", "Tarrant", cb = TRUE)
mapboxgl(style = mapbox_style("light")) |>
add_fill_extrusion_layer(
id = "tracts",
@han-tun
han-tun / .block
Created May 28, 2024 21:48 — forked from ColinEberhardt/.block
Health and Wealth of Nations - Bubble Chart
license: mit
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
@han-tun
han-tun / nycflights_calender.qmd
Created June 12, 2023 14:53 — forked from AlbertRapp/nycflights_calender.qmd
NYC flights calendar plot
library(tidyverse)
color_palette <- thematic::okabe_ito(8)
flights <- nycflights13::flights
counts <- flights %>%
mutate(
date = lubridate::make_date(year = year, month = month, day = day)
) %>%
count(date) %>%
mutate(
@han-tun
han-tun / street_orientation.R
Created May 11, 2023 15:18 — forked from marcosci/street_orientation.R
street_orientation
# load libraries
library(tidyverse)
library(osmdata)
library(sf)
library(ggtext)
library(exactextractr)
library(fasterize)
library(ggtext)
library(tidygeocoder)
library(glue)