Skip to content

Instantly share code, notes, and snippets.

View davebraze's full-sized avatar

Dave Braze davebraze

View GitHub Profile
library(tidycensus)
library(leaflet)
library(sf)
library(viridis)
options(tigris_use_cache = TRUE)
il1 <- get_acs(geography = "county",
variables = c(hhincome = "B19013_001"),
state = "IL",
geometry = TRUE) %>%
@ehbick01
ehbick01 / poverty_by_tract.R
Created November 20, 2017 20:29
Using `tidycensus` to pull poverty rates by census tract and limit to high-poverty tracts (>= 35% poverty)
## Load Packages
library(tidycensus)
library(purrr)
## Grab Data
# Set API key
census_api_key("your_api_key_here")
# Identify state FIPS codes
us <- unique(fips_codes$state)[1:51]
library(tidycensus)
library(tidyverse)
# If not set, un-comment below and install your Census API key (https://api.census.gov/data/key_signup.html)
# census_api_key("YOUR KEY HERE", install = TRUE)
get_acs(geography = "metropolitan statistical area/micropolitan statistical area",
variables = "DP03_0021PE",
summary_var = "B01003_001",
survey = "acs1",
@ehbick01
ehbick01 / hurricane_code.R
Created September 17, 2017 21:14
Pulling NOAA weather station info using rvest
# -----------------------------------
# Pulling Historical Buoy Information
# October 2016
# -----------------------------------
## Load Packages
library(tidyverse)
library(xml2)
library(rvest)
library(RCurl)
@benmarwick
benmarwick / captions_and_crossrefs.rmd
Last active March 24, 2023 17:53
Auto-numbering and cross-referencing of figures and tables in rmarkdown
---
title: "Auto-numbering and cross-referencing of figures and tables in rmarkdown"
output: html_document
---
NOTE: I recommend using the bookdown package and `output: html_document2` to make captions and cross-references more easily than the method described below.
TODO: check this out: https://github.com/adletaw/captioner
Here's how to use: