This file contains 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
--- | |
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: |
This file contains 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
# ----------------------------------- | |
# Pulling Historical Buoy Information | |
# October 2016 | |
# ----------------------------------- | |
## Load Packages | |
library(tidyverse) | |
library(xml2) | |
library(rvest) | |
library(RCurl) |
This file contains 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(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", |
This file contains 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
## 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] |
This file contains 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(leaflet) | |
library(sf) | |
library(viridis) | |
options(tigris_use_cache = TRUE) | |
il1 <- get_acs(geography = "county", | |
variables = c(hhincome = "B19013_001"), | |
state = "IL", | |
geometry = TRUE) %>% |