diff --git a/datasets/US_counties.rds b/datasets/US_counties.rds new file mode 100644 index 0000000..a454999 Binary files /dev/null and b/datasets/US_counties.rds differ diff --git a/datasets/US_counties_AKsmall.rds b/datasets/US_counties_AKsmall.rds new file mode 100644 index 0000000..1e30f5d Binary files /dev/null and b/datasets/US_counties_AKsmall.rds differ diff --git a/datasets/US_state_stats.R b/datasets/US_state_stats.R new file mode 100644 index 0000000..d21c355 --- /dev/null +++ b/datasets/US_state_stats.R @@ -0,0 +1,42 @@ +library(tidyverse) +library(usdata) +library(here) + +US_state_stats <- usdata::state_stats %>% + mutate( + popdens2010 = pop2010/land_area + ) %>% + select(-abbr, -fips, -pop2000, -pop2010, -land_area) + +write_csv(US_state_stats, here("datasets", "US_state_stats.csv")) + +US_state_stats %>% + column_to_rownames(var = "state") %>% + scale() %>% + dist(method = "euclidean") %>% + hclust(method = "ward.D2") %>% + ggdendrogram(rotate = TRUE) + +US_regions <- read_csv(here("datasets", "US_regions.csv")) + +dhc <- US_state_stats %>% + column_to_rownames(var = "state") %>% + scale() %>% + dist(method = "euclidean") %>% + hclust(method = "ward.D2") %>% + as.dendrogram() + +# Rectangular lines +ddata <- dendro_data(dhc, type = "rectangle") +segments <- segment(ddata) +labels <- label(ddata) %>% + left_join(US_regions, by = c("label" = "state")) + +ggplot() + + geom_segment(data = segments, aes(y, x, xend = yend, yend = xend)) + + geom_text(data = labels, aes(y, x, label = label, color = region), hjust = 1) + + scale_x_continuous(limits = c(-10, 25)) + + theme_void() + +head(segment(ddata)) +head(label(ddata)) diff --git a/datasets/US_state_stats.csv b/datasets/US_state_stats.csv new file mode 100644 index 0000000..da8948a --- /dev/null +++ b/datasets/US_state_stats.csv @@ -0,0 +1,52 @@ +state,homeownership,multiunit,income,med_income,poverty,fed_spend,smoke,murder,robbery,agg_assault,larceny,motor_theft,soc_sec,nuclear,coal,tr_deaths,tr_deaths_no_alc,unempl,popdens2010 +Alabama,71.1,15.5,22984,42081,17.1,11.726134037528432,24.8,8.2,141.4,5.2,55.4,6,18.5,16.3,56.6,23.7,1.3,7.6,94.37663847782214 +Alaska,64.7,24.6,30726,66521,9.5,16.78656803209097,25,4.8,80.9,65.5,366,55.1,8.9,0,9.5,10.1,7.3,7.1,1.2446197560830503 +Arizona,67.4,20.7,25680,50448,15.3,9.847127596813337,20.4,7.5,144.4,5.1,46.4,14.5,13.9,15.6,39.6,18.4,0.9,8.7,56.270687697809606 +Arkansas,67.7,15.2,21274,39267,18,9.61118556831845,23.5,6.7,91.1,13.3,93,9,18.7,13,48.2,22.2,2.2,7.6,56.03711160154571 +California,57.4,30.7,29188,60883,13.7,8.885791055317723,15.2,6.9,176.1,0.9,5.1,1.9,11.8,7,1.1,11.6,0.2,10.9,239.14586297196763 +Colorado,67.6,25.6,30151,56456,12.2,9.152294521828141,19.9,3.7,84.6,5.3,54.4,11.1,11.4,0,71.7,12,1.2,7.8,48.524742263962956 +Connecticut,69.2,34.6,36775,67740,9.2,14.834472035873677,16.5,2.9,113,3.9,51,8.3,16.3,25.6,11.9,7.7,1.6,7.8,738.0898983140453 +Delaware,73.6,17.7,29007,57599,11,8.889538652061287,20.7,4.4,154.8,47.7,238.8,31,16.6,0,59.4,14.9,5.7,7,460.82400156014245 +District of Columbia,43.5,61.7,42078,58526,18.5,100.9090661317583,20.1,35.4,672.1,119.9,447.9,233,12,0,0,8,7.5,9.9,9856.232596232596 +Florida,69.7,30,26551,47661,13.8,9.62100146213216,21.6,5,169.4,2.6,14.1,2.3,18,7.3,28.4,18.8,0.3,9.4,350.60874864521537 +Georgia,67.2,20.5,25134,49347,15.7,8.882244646871643,22.2,6.2,154.8,2.7,28.4,5.1,12.3,11.1,63.8,17.8,0.7,9.1,168.4414039210627 +Hawaii,59.3,39.2,28882,66420,9.6,13.956767656570127,17.1,1.9,78.5,10.9,243.2,52.7,14.6,0,14.2,10.3,3.6,6.4,211.79812631274103 +Idaho,71,14.9,22518,46423,13.6,8.824437892244234,17.9,2.4,18.6,12.5,123.2,12.9,14,0,0.9,17.5,4.3,8,18.96808832967584 +Illinois,69.2,33,28782,55735,12.6,8.517012256294157,19.9,6,181.7,2.6,16.9,2.4,14.7,26.8,47.5,10.6,0.4,9.1,231.10373344731246 +Indiana,71.5,18.6,24058,47697,13.5,9.449773605054565,27.3,5.7,108.6,2.8,37.2,5.3,16,0,94.2,14.5,1,8.4,180.97979378726856 +Iowa,73.2,18.6,25335,48872,11.6,9.502676149037129,20.4,1.3,38.9,7.3,67.1,6.1,17.9,5.2,77.6,14.8,2.4,5.3,54.538337361765635 +Kansas,69.4,17.4,25907,49424,12.4,10.36470450924217,17.8,NA,NA,NA,NA,NA,15.7,10.6,75.2,15,2.3,6.1,34.89680366815919 +Kentucky,69.9,17.7,22515,41576,17.7,12.963916856997807,28.7,NA,NA,NA,NA,NA,18.1,0,91.1,22.7,1.6,8.7,109.89539673720077 +Louisiana,68.2,17.8,23094,43445,18.1,11.611366770695192,22.6,9.9,118,9.6,55,7,16.3,7.9,24.9,21.1,1.3,7,104.92969384708324 +Maine,73.1,19.4,25385,46933,12.6,10.887619404664846,20.9,1.4,24.4,4.6,138,7.7,19.9,0,1.7,12.7,4.9,7.1,43.06858753970117 +Maryland,69,25.7,34849,70647,8.6,16.639838006135566,19,9.9,256.7,7.2,39.7,10.5,13.2,13.9,55.7,10.6,1.1,6.5,594.7676167479119 +Massachusetts,64,41.7,33966,64509,10.5,12.488459868450091,18.1,2.7,119,4.7,23.3,4.5,16.3,4.9,25.3,6.8,0.9,6.9,839.4331582064752 +Michigan,74.2,18,25135,48432,14.8,9.239120101501067,22.1,6.1,131.8,3.7,19.4,4.8,17.4,13.1,57.8,11.4,0.6,8.8,174.81132459244873 +Minnesota,74.2,21.5,29582,57243,10.6,8.359493016963853,20,2.2,92,3,42,5.2,14.6,13.4,62.1,10.5,1.2,5.7,66.60984739548549 +Mississippi,70.8,13.4,19977,37881,21.2,11.156513486853523,23.7,7.3,82.3,5,70.2,8.6,18.4,7.5,36.9,31.4,2,9.5,63.237216843583155 +Missouri,70,19.6,24724,46262,14,11.249529840654262,23.4,6.9,124.1,6.1,45.9,7.4,17.5,5.8,85.3,21,1,7.4,87.12241160800633 +Montana,69,16.3,23836,43872,14.5,10.463793251567846,19.2,NA,NA,NA,NA,NA,16.8,0,63.8,25.4,5.1,6.2,6.797963252804273 +Nebraska,68.6,19.3,25229,49342,11.8,9.193895334989469,21.3,2.5,59.1,10.5,141,17.3,15.9,17.6,66.2,15.1,3.7,4,23.773000085780296 +Nevada,60.1,29.4,27589,55726,11.9,7.366538532321737,23.1,8.5,194.7,13.4,79.8,41.3,12.6,0,45.7,15.8,2.3,12.3,24.599398549004484 +New Hampshire,72.6,25.7,31422,63277,7.8,8.945479198158713,20.5,1.4,27.4,5.5,104.6,7.8,16.6,28.2,17.2,12.6,4.9,5.2,147.0480807358715 +New Jersey,66.9,36,34858,69811,9.1,9.052934100433877,18.1,4.8,151.6,2.1,17.8,3.6,15.6,22.7,19.2,8.5,0.7,9,1195.489664437561 +New Mexico,69.6,15.1,22966,43820,18.4,13.340663439166775,21.5,7.4,98.7,26.3,128.2,20.1,14.8,0,85.2,23.7,3,7.2,16.97617811978171 +New York,55.2,50.6,30948,55603,14.2,10.063556740489858,20.5,4.5,182.7,1.2,8.1,1,15.7,13.2,14,7.4,0.3,8.5,411.1941926393699 +North Carolina,68.1,16.9,24745,45570,15.5,9.002574489409714,22.7,6.7,145.5,3,26.7,3.4,15.4,18.2,60.5,16.1,0.7,9.9,196.13107597591093 +North Dakota,66.6,25.9,25803,46781,12.3,13.29540389330217,20,1.1,7.4,9.7,223.1,24.7,17.1,0,94.8,18.3,7.8,3.1,9.747582636723052 +Ohio,69.2,23,25113,47358,14.2,9.116575784137032,22.3,5.1,163.1,1.2,21.1,3.1,16.9,6.2,87.2,11.5,0.5,7.6,282.3374739878352 +Oklahoma,68.2,15.3,23094,42979,16.2,10.194196437496785,25.1,5.3,91,9.9,70.5,10.4,16.6,0,53,21.4,1.7,6,54.688466726107414 +Oregon,63.8,23.3,26171,49260,14,8.770311406148771,18.5,2.2,68.1,4.7,81.2,13.8,15.9,0,7,12.7,1.7,8.8,39.912005676542314 +Pennsylvania,71,20.7,27049,50398,12.4,11.012162288654748,23.7,6.1,154.6,1.9,13.6,1.9,18.9,20.5,55.5,12.7,0.5,7.6,283.8983566034236 +Rhode Island,62.5,40.5,28707,54902,12.2,10.869811612942454,19.8,3.2,72.1,13.9,172.5,38.8,18.2,0,0,8.3,4.8,11,1018.1435660324431 +South Carolina,69.9,17.4,23443,43939,16.4,10.449227347296343,22.6,7.4,132.1,12.5,63.9,8.3,16.2,28.7,38.7,23.6,1.2,9.1,153.8674748093025 +South Dakota,68.9,18.5,24110,46369,13.7,11.84471124321403,19.8,2.3,18.6,13.3,165,13.3,17.2,0,46,22.8,7,4.3,10.739602432364697 +Tennessee,69.6,18.1,23722,43314,16.5,10.3252792066945,26.8,7.2,167.3,8.5,44.6,6.6,16.9,16.4,61,20,1,8,153.901306902648 +Texas,64.8,24.1,24870,49646,16.8,8.605075424644532,20,6.2,156.6,1.3,11.8,1.6,11.4,4.8,37.4,13.9,0.2,7.1,96.25769015560937 +Utah,71.2,21.4,23139,56330,10.8,8.082408276755364,11.5,2.3,44.3,5.2,105.6,12.4,9.5,0,94.2,10.2,3.1,5.7,33.63633664120633 +Vermont,71.4,23.2,27478,51841,11.1,10.822412148157145,19.3,1.3,11.7,13.3,269.5,16.4,17.6,50.5,0,11.7,9.6,4.9,67.8923818389742 +Virginia,68.9,21.4,32145,61406,10.3,15.97270874328086,20.6,6.1,99.2,1.9,25.4,2.6,13.9,15.2,44.9,11.8,0.8,5.7,202.6084012469964 +Washington,64.8,25.9,29733,57244,12.1,10.258140482471664,17.6,3.3,92.1,3.1,46.8,11.7,13.6,4.1,10.3,9.6,0.8,8.2,101.1885844847802 +West Virginia,74.6,12.1,21232,38380,17.4,11.044192263979268,26.6,4.4,44.6,11.1,96.8,11.3,22,0,97.6,20.2,3.6,7.2,77.08535702117587 +Wisconsin,69.5,25.5,26624,51598,11.6,9.241626935603499,20.8,3.5,82.2,2.4,35,4,16.5,9.8,67.4,14.3,1,6.9,105.0076997219237 +Wyoming,70.2,15.8,27860,53802,9.8,11.543092405247451,21.3,2.7,15.3,33.4,449.6,25.7,14.7,0,95.1,30.2,11,5.4,5.805003319493014 diff --git a/datasets/US_states.R b/datasets/US_states.R new file mode 100644 index 0000000..6844314 --- /dev/null +++ b/datasets/US_states.R @@ -0,0 +1,192 @@ +library(tidyverse) +library(sf) +library(ggrepel) +library(here) + +state_codes <- read_csv(file = +"name,state_code,GEOID +Alabama,AL,01 +Alaska,AK,02 +Arizona,AZ,04 +Arkansas,AR,05 +California,CA,06 +Colorado,CO,08 +Connecticut,CT,09 +Delaware,DE,10 +District of Columbia,DC,11 +Florida,FL,12 +Georgia,GA,13 +Hawaii,HI,15 +Idaho,ID,16 +Illinois,IL,17 +Indiana,IN,18 +Iowa,IA,19 +Kansas,KS,20 +Kentucky,KY,21 +Louisiana,LA,22 +Maine,ME,23 +Maryland,MD,24 +Massachusetts,MA,25 +Michigan,MI,26 +Minnesota,MN,27 +Mississippi,MS,28 +Missouri,MO,29 +Montana,MT,30 +Nebraska,NE,31 +Nevada,NV,32 +New Hampshire,NH,33 +New Jersey,NJ,34 +New Mexico,NM,35 +New York,NY,36 +North Carolina,NC,37 +North Dakota,ND,38 +Ohio,OH,39 +Oklahoma,OK,40 +Oregon,OR,41 +Pennsylvania,PA,42 +Rhode Island,RI,44 +South Carolina,SC,45 +South Dakota,SD,46 +Tennessee,TN,47 +Texas,TX,48 +Utah,UT,49 +Vermont,VT,50 +Virginia,VA,51 +Washington,WA,53 +West Virginia,WV,54 +Wisconsin,WI,55 +Wyoming,WY,56 +American Samoa,AS,60 +Guam,GU,66 +Northern Mariana Islands,MP,69 +Puerto Rico,PR,72 +Virgin Islands,VI,78") + +US_states_AKsmall <- dviz.supp::US_states_geoms$us_albers %>% + left_join(state_codes) + +# This is the projection used. Overwriting it to make the +# dataset less likely to cause problems with newer +# installations of R/sf +# ESRI:102003 +# https://epsg.io/102003 +st_crs(US_states_AKsmall) <- 102003 + +label_coords <- US_states_AKsmall$geometry %>% + sf::st_zm() %>% + sf::st_point_on_surface() %>% + sf::st_coordinates() + +US_states_AKsmall$label_x <- label_coords[, 1] +US_states_AKsmall$label_y <- label_coords[, 2] + +# manually adjust label positions +labels_pos <- read_csv( + file="state_code,xoff,yoff,hjust,vjust,segment +AK, 30000, 70000, 0.5, 0.5, FALSE +CT, 450000, -140000, 0, 0.5, TRUE +DC, 450000, -390000, 0, 0.5, TRUE +DE, 150000, -70000, 0, 0.5, TRUE +HI, 150000, 0, 0, 0.5, FALSE +ID, 0, -180000, 0.5, 0.5, FALSE +MA, 450000, 150000, 0, 0.5, TRUE +MD, 450000, -230000, 0, 0.5, TRUE +MI, 180000, -300000, 0.5, 0.5, FALSE +NH, -160000, 240000, 0.5, -.1, TRUE +NJ, 400000, -100000, 0, 0.5, TRUE +RI, 450000, 20000, 0, 0.5, TRUE +VT, -290000, 140000, 1, 0.5, TRUE +") + +US_states_AKsmall2 <- US_states_AKsmall %>% + left_join(labels_pos, by = "state_code") %>% + mutate( + label_xend = label_x, + label_yend = label_y, + label_x = ifelse(is.na(xoff), label_x, label_x + xoff), + label_y = ifelse(is.na(yoff), label_y, label_y + yoff), + hjust = ifelse(is.na(hjust), 0.5, hjust), + vjust = ifelse(is.na(vjust), 0.5, vjust), + segment = ifelse(is.na(segment), FALSE, segment) + ) + +ggplot(US_states_AKsmall2) + + geom_sf() + + geom_text( + aes(x = label_x, y = label_y, label = state_code, hjust = hjust, vjust = vjust), + size = 9/.pt + ) + + geom_segment( + data = filter(US_states_AKsmall2, segment == TRUE), + aes(x = label_x, y = label_y, xend = label_xend, yend = label_yend) + ) + + theme_void() + + coord_sf(default_crs = NULL) + +saveRDS(US_states_AKsmall2, here("datasets", "US_states_AKsmall.rds")) + +US_states <- dviz.supp::US_states_geoms$albers_revised %>% + left_join(state_codes) + +# This is the projection used. Overwriting it to make the +# dataset less likely to cause problems with newer +# installations of R/sf +# ESRI:102003 +# https://epsg.io/102003 +st_crs(US_states) <- 102003 + +saveRDS(US_states, here("datasets", "US_states.rds")) + +US_counties_AKsmall <- dviz.supp::US_counties_geoms$us_albers %>% + left_join(state_codes, by = c(STATEFP = "GEOID")) + +# This is the projection used. Overwriting it to make the +# dataset less likely to cause problems with newer +# installations of R/sf +# ESRI:102003 +# https://epsg.io/102003 +st_crs(US_counties_AKsmall) <- 102003 +saveRDS(US_counties_AKsmall, here("datasets", "US_counties_AKsmall.rds")) + +US_counties <- dviz.supp::US_counties_geoms$albers_revised %>% + left_join(state_codes, by = c(STATEFP = "GEOID")) + +# This is the projection used. Overwriting it to make the +# dataset less likely to cause problems with newer +# installations of R/sf +# ESRI:102003 +# https://epsg.io/102003 +st_crs(US_counties) <- 102003 + +saveRDS(US_counties, here("datasets", "US_counties.rds")) + +ggplot(US_states) + + geom_sf() + + theme_void() + +ggplot(US_counties_AKsmall) + + geom_sf() + + theme_void() + +ggplot(US_counties) + + geom_sf() + + theme_void() + + + +US_states <- readRDS(url("https://wilkelab.org/SDS375/datasets/US_states_AKsmall.rds")) + +ggplot(US_states) + + geom_sf() + + geom_text( + aes(x = label_x, y = label_y, label = state_code, hjust = hjust, vjust = vjust), + size = 9/.pt + ) + + geom_segment( + data = filter(US_states, segment == TRUE), + aes(x = label_x, y = label_y, xend = label_xend, yend = label_yend) + ) + + theme_void() + + coord_sf(default_crs = NULL) + + diff --git a/datasets/US_states.rds b/datasets/US_states.rds new file mode 100644 index 0000000..3ab2369 Binary files /dev/null and b/datasets/US_states.rds differ diff --git a/datasets/US_states_AKsmall.rds b/datasets/US_states_AKsmall.rds new file mode 100644 index 0000000..7175aa0 Binary files /dev/null and b/datasets/US_states_AKsmall.rds differ diff --git a/docs/datasets/US_counties.rds b/docs/datasets/US_counties.rds new file mode 100644 index 0000000..a454999 Binary files /dev/null and b/docs/datasets/US_counties.rds differ diff --git a/docs/datasets/US_counties_AKsmall.rds b/docs/datasets/US_counties_AKsmall.rds new file mode 100644 index 0000000..1e30f5d Binary files /dev/null and b/docs/datasets/US_counties_AKsmall.rds differ diff --git a/docs/datasets/US_state_stats.csv b/docs/datasets/US_state_stats.csv new file mode 100644 index 0000000..da8948a --- /dev/null +++ b/docs/datasets/US_state_stats.csv @@ -0,0 +1,52 @@ +state,homeownership,multiunit,income,med_income,poverty,fed_spend,smoke,murder,robbery,agg_assault,larceny,motor_theft,soc_sec,nuclear,coal,tr_deaths,tr_deaths_no_alc,unempl,popdens2010 +Alabama,71.1,15.5,22984,42081,17.1,11.726134037528432,24.8,8.2,141.4,5.2,55.4,6,18.5,16.3,56.6,23.7,1.3,7.6,94.37663847782214 +Alaska,64.7,24.6,30726,66521,9.5,16.78656803209097,25,4.8,80.9,65.5,366,55.1,8.9,0,9.5,10.1,7.3,7.1,1.2446197560830503 +Arizona,67.4,20.7,25680,50448,15.3,9.847127596813337,20.4,7.5,144.4,5.1,46.4,14.5,13.9,15.6,39.6,18.4,0.9,8.7,56.270687697809606 +Arkansas,67.7,15.2,21274,39267,18,9.61118556831845,23.5,6.7,91.1,13.3,93,9,18.7,13,48.2,22.2,2.2,7.6,56.03711160154571 +California,57.4,30.7,29188,60883,13.7,8.885791055317723,15.2,6.9,176.1,0.9,5.1,1.9,11.8,7,1.1,11.6,0.2,10.9,239.14586297196763 +Colorado,67.6,25.6,30151,56456,12.2,9.152294521828141,19.9,3.7,84.6,5.3,54.4,11.1,11.4,0,71.7,12,1.2,7.8,48.524742263962956 +Connecticut,69.2,34.6,36775,67740,9.2,14.834472035873677,16.5,2.9,113,3.9,51,8.3,16.3,25.6,11.9,7.7,1.6,7.8,738.0898983140453 +Delaware,73.6,17.7,29007,57599,11,8.889538652061287,20.7,4.4,154.8,47.7,238.8,31,16.6,0,59.4,14.9,5.7,7,460.82400156014245 +District of Columbia,43.5,61.7,42078,58526,18.5,100.9090661317583,20.1,35.4,672.1,119.9,447.9,233,12,0,0,8,7.5,9.9,9856.232596232596 +Florida,69.7,30,26551,47661,13.8,9.62100146213216,21.6,5,169.4,2.6,14.1,2.3,18,7.3,28.4,18.8,0.3,9.4,350.60874864521537 +Georgia,67.2,20.5,25134,49347,15.7,8.882244646871643,22.2,6.2,154.8,2.7,28.4,5.1,12.3,11.1,63.8,17.8,0.7,9.1,168.4414039210627 +Hawaii,59.3,39.2,28882,66420,9.6,13.956767656570127,17.1,1.9,78.5,10.9,243.2,52.7,14.6,0,14.2,10.3,3.6,6.4,211.79812631274103 +Idaho,71,14.9,22518,46423,13.6,8.824437892244234,17.9,2.4,18.6,12.5,123.2,12.9,14,0,0.9,17.5,4.3,8,18.96808832967584 +Illinois,69.2,33,28782,55735,12.6,8.517012256294157,19.9,6,181.7,2.6,16.9,2.4,14.7,26.8,47.5,10.6,0.4,9.1,231.10373344731246 +Indiana,71.5,18.6,24058,47697,13.5,9.449773605054565,27.3,5.7,108.6,2.8,37.2,5.3,16,0,94.2,14.5,1,8.4,180.97979378726856 +Iowa,73.2,18.6,25335,48872,11.6,9.502676149037129,20.4,1.3,38.9,7.3,67.1,6.1,17.9,5.2,77.6,14.8,2.4,5.3,54.538337361765635 +Kansas,69.4,17.4,25907,49424,12.4,10.36470450924217,17.8,NA,NA,NA,NA,NA,15.7,10.6,75.2,15,2.3,6.1,34.89680366815919 +Kentucky,69.9,17.7,22515,41576,17.7,12.963916856997807,28.7,NA,NA,NA,NA,NA,18.1,0,91.1,22.7,1.6,8.7,109.89539673720077 +Louisiana,68.2,17.8,23094,43445,18.1,11.611366770695192,22.6,9.9,118,9.6,55,7,16.3,7.9,24.9,21.1,1.3,7,104.92969384708324 +Maine,73.1,19.4,25385,46933,12.6,10.887619404664846,20.9,1.4,24.4,4.6,138,7.7,19.9,0,1.7,12.7,4.9,7.1,43.06858753970117 +Maryland,69,25.7,34849,70647,8.6,16.639838006135566,19,9.9,256.7,7.2,39.7,10.5,13.2,13.9,55.7,10.6,1.1,6.5,594.7676167479119 +Massachusetts,64,41.7,33966,64509,10.5,12.488459868450091,18.1,2.7,119,4.7,23.3,4.5,16.3,4.9,25.3,6.8,0.9,6.9,839.4331582064752 +Michigan,74.2,18,25135,48432,14.8,9.239120101501067,22.1,6.1,131.8,3.7,19.4,4.8,17.4,13.1,57.8,11.4,0.6,8.8,174.81132459244873 +Minnesota,74.2,21.5,29582,57243,10.6,8.359493016963853,20,2.2,92,3,42,5.2,14.6,13.4,62.1,10.5,1.2,5.7,66.60984739548549 +Mississippi,70.8,13.4,19977,37881,21.2,11.156513486853523,23.7,7.3,82.3,5,70.2,8.6,18.4,7.5,36.9,31.4,2,9.5,63.237216843583155 +Missouri,70,19.6,24724,46262,14,11.249529840654262,23.4,6.9,124.1,6.1,45.9,7.4,17.5,5.8,85.3,21,1,7.4,87.12241160800633 +Montana,69,16.3,23836,43872,14.5,10.463793251567846,19.2,NA,NA,NA,NA,NA,16.8,0,63.8,25.4,5.1,6.2,6.797963252804273 +Nebraska,68.6,19.3,25229,49342,11.8,9.193895334989469,21.3,2.5,59.1,10.5,141,17.3,15.9,17.6,66.2,15.1,3.7,4,23.773000085780296 +Nevada,60.1,29.4,27589,55726,11.9,7.366538532321737,23.1,8.5,194.7,13.4,79.8,41.3,12.6,0,45.7,15.8,2.3,12.3,24.599398549004484 +New Hampshire,72.6,25.7,31422,63277,7.8,8.945479198158713,20.5,1.4,27.4,5.5,104.6,7.8,16.6,28.2,17.2,12.6,4.9,5.2,147.0480807358715 +New Jersey,66.9,36,34858,69811,9.1,9.052934100433877,18.1,4.8,151.6,2.1,17.8,3.6,15.6,22.7,19.2,8.5,0.7,9,1195.489664437561 +New Mexico,69.6,15.1,22966,43820,18.4,13.340663439166775,21.5,7.4,98.7,26.3,128.2,20.1,14.8,0,85.2,23.7,3,7.2,16.97617811978171 +New York,55.2,50.6,30948,55603,14.2,10.063556740489858,20.5,4.5,182.7,1.2,8.1,1,15.7,13.2,14,7.4,0.3,8.5,411.1941926393699 +North Carolina,68.1,16.9,24745,45570,15.5,9.002574489409714,22.7,6.7,145.5,3,26.7,3.4,15.4,18.2,60.5,16.1,0.7,9.9,196.13107597591093 +North Dakota,66.6,25.9,25803,46781,12.3,13.29540389330217,20,1.1,7.4,9.7,223.1,24.7,17.1,0,94.8,18.3,7.8,3.1,9.747582636723052 +Ohio,69.2,23,25113,47358,14.2,9.116575784137032,22.3,5.1,163.1,1.2,21.1,3.1,16.9,6.2,87.2,11.5,0.5,7.6,282.3374739878352 +Oklahoma,68.2,15.3,23094,42979,16.2,10.194196437496785,25.1,5.3,91,9.9,70.5,10.4,16.6,0,53,21.4,1.7,6,54.688466726107414 +Oregon,63.8,23.3,26171,49260,14,8.770311406148771,18.5,2.2,68.1,4.7,81.2,13.8,15.9,0,7,12.7,1.7,8.8,39.912005676542314 +Pennsylvania,71,20.7,27049,50398,12.4,11.012162288654748,23.7,6.1,154.6,1.9,13.6,1.9,18.9,20.5,55.5,12.7,0.5,7.6,283.8983566034236 +Rhode Island,62.5,40.5,28707,54902,12.2,10.869811612942454,19.8,3.2,72.1,13.9,172.5,38.8,18.2,0,0,8.3,4.8,11,1018.1435660324431 +South Carolina,69.9,17.4,23443,43939,16.4,10.449227347296343,22.6,7.4,132.1,12.5,63.9,8.3,16.2,28.7,38.7,23.6,1.2,9.1,153.8674748093025 +South Dakota,68.9,18.5,24110,46369,13.7,11.84471124321403,19.8,2.3,18.6,13.3,165,13.3,17.2,0,46,22.8,7,4.3,10.739602432364697 +Tennessee,69.6,18.1,23722,43314,16.5,10.3252792066945,26.8,7.2,167.3,8.5,44.6,6.6,16.9,16.4,61,20,1,8,153.901306902648 +Texas,64.8,24.1,24870,49646,16.8,8.605075424644532,20,6.2,156.6,1.3,11.8,1.6,11.4,4.8,37.4,13.9,0.2,7.1,96.25769015560937 +Utah,71.2,21.4,23139,56330,10.8,8.082408276755364,11.5,2.3,44.3,5.2,105.6,12.4,9.5,0,94.2,10.2,3.1,5.7,33.63633664120633 +Vermont,71.4,23.2,27478,51841,11.1,10.822412148157145,19.3,1.3,11.7,13.3,269.5,16.4,17.6,50.5,0,11.7,9.6,4.9,67.8923818389742 +Virginia,68.9,21.4,32145,61406,10.3,15.97270874328086,20.6,6.1,99.2,1.9,25.4,2.6,13.9,15.2,44.9,11.8,0.8,5.7,202.6084012469964 +Washington,64.8,25.9,29733,57244,12.1,10.258140482471664,17.6,3.3,92.1,3.1,46.8,11.7,13.6,4.1,10.3,9.6,0.8,8.2,101.1885844847802 +West Virginia,74.6,12.1,21232,38380,17.4,11.044192263979268,26.6,4.4,44.6,11.1,96.8,11.3,22,0,97.6,20.2,3.6,7.2,77.08535702117587 +Wisconsin,69.5,25.5,26624,51598,11.6,9.241626935603499,20.8,3.5,82.2,2.4,35,4,16.5,9.8,67.4,14.3,1,6.9,105.0076997219237 +Wyoming,70.2,15.8,27860,53802,9.8,11.543092405247451,21.3,2.7,15.3,33.4,449.6,25.7,14.7,0,95.1,30.2,11,5.4,5.805003319493014 diff --git a/docs/datasets/US_states.rds b/docs/datasets/US_states.rds new file mode 100644 index 0000000..3ab2369 Binary files /dev/null and b/docs/datasets/US_states.rds differ diff --git a/docs/datasets/US_states_AKsmall.rds b/docs/datasets/US_states_AKsmall.rds new file mode 100644 index 0000000..7175aa0 Binary files /dev/null and b/docs/datasets/US_states_AKsmall.rds differ diff --git a/docs/materials/positconf2024.Rmd b/docs/materials/positconf2024.Rmd new file mode 100644 index 0000000..01d8935 --- /dev/null +++ b/docs/materials/positconf2024.Rmd @@ -0,0 +1,19 @@ +--- +title: "posit::conf(2024): Effective Data Visualization with ggplot2" +description: "" +output: + distill::distill_article: + toc: true + toc_depth: 2 +--- + +```{r setup, include=FALSE} +knitr::opts_chunk$set(echo = FALSE) +``` + +Materials for posit::conf(2024) workshop, [Monday, Aug. 12, 9am](https://reg.conf.posit.co/flow/posit/positconf24/publiccatalog/page/publiccatalog/session/1707334048207001SOYr) + + +## Reuse {.appendix} + +Text and figures are licensed under Creative Commons Attribution [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). Any computer code (R, HTML, CSS, etc.) in slides and worksheets, including in slide and worksheet sources, is also licensed under [MIT](https://github.com/wilkelab/SDS375/LICENSE.md). Note that figures in slides may be pulled in from external sources and may be licensed under different terms. \ No newline at end of file diff --git a/docs/materials/positconf2024.html b/docs/materials/positconf2024.html new file mode 100644 index 0000000..b3c27ad --- /dev/null +++ b/docs/materials/positconf2024.html @@ -0,0 +1,2390 @@ + + + + +
+ + + + + + + + + + + + + + + +Materials for posit::conf(2024) workshop, Monday, Aug. 12, 9am
+Text and figures are licensed under Creative Commons Attribution CC BY 4.0. Any computer code (R, HTML, CSS, etc.) in slides and worksheets, including in slide and worksheet sources, is also licensed under MIT. Note that figures in slides may be pulled in from external sources and may be licensed under different terms.
+
Materials for past and present workshops. The specific slide sets may differ from the four main lessons. All materials are primarily based on material from my semester-long data visualization course at UT Austin.
-Visualizing Uncertainty and Trends
+Materials for past and present workshops. Many workshop materials are based on content from my semester-long data visualization course at UT Austin.
+2024-08-12: Effective Data Visualization with ggplot2
+All workshop materials will be posted here.
+2024-06-24: Visualizing Uncertainty and Trends
2024-06-20
+2024-06-20: Effective Visual Communication with R
Workshop in support of Ukraine. To work through all the examples provided, you will need the following R packages: tidyverse, cowplot, ggiraph, sf, patchwork
2024-05-28
+2024-05-28: Effective Visual Communication
Text and figures are licensed under Creative Commons Attribution CC BY 4.0. Any computer code (R, HTML, CSS, etc.) in slides and worksheets, including in slide and worksheet sources, is also licensed under MIT. Note that figures in slides may be pulled in from external sources and may be licensed under different terms. For such images, image credits are available in the slide notes, accessible via pressing the letter ‘p’.
+Text and figures are licensed under Creative Commons Attribution CC BY 4.0. Any computer code (R, HTML, CSS, etc.) in slides and worksheets, including in slide and worksheet sources, is also licensed under MIT. Note that figures in slides may be pulled in from external sources and may be licensed under different terms.
Materials for posit::conf(2024) workshop, Monday, Aug. 12, 9am
+Text and figures are licensed under Creative Commons Attribution CC BY 4.0. Any computer code (R, HTML, CSS, etc.) in slides and worksheets, including in slide and worksheet sources, is also licensed under MIT. Note that figures in slides may be pulled in from external sources and may be licensed under different terms.
+