This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidycensus) | |
| library(ggiraph) | |
| library(tidyverse) | |
| library(patchwork) | |
| vt_income <- get_acs( | |
| geography = "county", | |
| variables = "B19013_001", | |
| state = "VT", | |
| year = 2019, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| !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() |
NewerOlder
