suppressPackageStartupMessages({
library(covdata)
library(dplyr)
library(ggplot2)
library(geofacet)
library(glue)
})
pop_state <- uspop %>%
filter(sex_id == "totsex" & hisp_id == "tothisp") %>%
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
This is I think closest to what was described, however it holds all of the data in memory still... | |
``` r | |
library(ipumsr) | |
ddi <- read_ipums_ddi(ipums_example("cps_00006.xml")) | |
# (These are just the names for an extract included with ipumsr - they stand in for | |
# REPWT1-REPWT40, REPWT41-REPWT80, etc.) | |
var_groups <- list( | |
HH_RE1 = tidyselect::vars_select(ddi$var_info$var_name, YEAR:SERIAL), |
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(purrr) | |
library(ipumsr) # requires development version: devtools::install_github("mnpopcenter/ipumsr") | |
library(rmapshaper) | |
library(ggplot2) | |
library(gganimate) # devtools::install_github("thomasp85/gganimate") | |
library(stringr) | |
library(dplyr) | |
library(tidyr) | |
library(cartogram) | |
library(sf) |
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
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<meta name="generator" content="pandoc"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta name="author" content="Minnesota Population Center"> |
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
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta name="generator" content="pandoc" /> |
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
Hitting an error with transformr, not sure if I'm specifying it wrong though... | |
``` r | |
library(tidycensus) | |
library(rmapshaper) | |
library(cartogram) | |
library(sf) | |
#> Linking to GEOS 3.6.1, GDAL 2.2.3, proj.4 4.9.3 | |
library(transformr) | |
library(ggplot2) |
This file has been truncated, but you can view the full file.
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
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta name="generator" content="pandoc" /> |
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
``` r | |
suppressPackageStartupMessages({ | |
library(survey) | |
library(srvyr) | |
library(dplyr) | |
}) | |
# stratified sample from examples | |
data(api) | |
dstrata <- apistrat %>% | |
as_survey(strata = stype, weights = pw) |