Browse Source

Day 13

master
boB Rudis 4 years ago
parent
commit
2ca633647e
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 52
      2019-11-13-tracks.R
  2. 1
      data/RR1826-1911Modified0509161/RR1826-1911Modified050916.cpg
  3. BIN
      data/RR1826-1911Modified0509161/RR1826-1911Modified050916.dbf
  4. 1
      data/RR1826-1911Modified0509161/RR1826-1911Modified050916.prj
  5. BIN
      data/RR1826-1911Modified0509161/RR1826-1911Modified050916.sbn
  6. BIN
      data/RR1826-1911Modified0509161/RR1826-1911Modified050916.sbx
  7. BIN
      data/RR1826-1911Modified0509161/RR1826-1911Modified050916.shp
  8. 7323
      data/RR1826-1911Modified0509161/RR1826-1911Modified050916.shp.xml
  9. BIN
      data/RR1826-1911Modified0509161/RR1826-1911Modified050916.shx
  10. BIN
      data/ne-rr.rds

52
2019-11-13-tracks.R

@ -0,0 +1,52 @@
library(sf)
library(magick)
library(tweenr)
library(rnaturalearth)
library(hrbrthemes)
library(tidyverse)
# https://my.vanderbilt.edu/jeremyatack/data-downloads/
r1 <- st_read(here::here("data/RR1826-1911Modified0509161/RR1826-1911Modified050916.shp"))
ne_states("United States of America", returnclass = "sf") %>%
filter(!(name %in% c("Alaska", "Hawaii"))) -> states
border <- st_union(states)
in_op_rng <- sort(unique(r1$InOpBy))
img <- image_graph(width=1000*2, height=600*2, res=144)
pb <- progress_estimated(length(in_op_rng))
for (i in in_op_rng) {
pb$tick()$print()
ggplot() +
geom_sf(data = border, color = "#252525", size = 1, fill = NA) +
geom_sf(data = states, color = "#b2b2b2", size = 0.1, fill = "white", linetype = "dotted") +
geom_sf(data = filter(r1, InOpBy <= i), aes(color = InOpBy), size = 0.1) +
coord_sf(crs = albersusa::us_laea_proj, datum = NA) +
scale_color_continuous(limits = range(r1$InOpBy)) +
labs(
x = NULL, y = NULL,
title = sprintf("U.S. Railroad Expansion • Year: %s", i),
subtitle = "The 'Ties' That Bound Us Together",
caption = "Data source: <my.vanderbilt.edu/jeremyatack/data-downloads/>\nhttps://git.rud.is/hrbrmstr/y2019-30daymapchallenge • #30DayMapChallenge"
) +
theme_ipsum_es(grid="") +
theme(plot.title = element_text(hjust = 0.5)) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
theme(panel.background = element_rect(fill = "#b15928")) +
theme(legend.position = "none") -> gg
print(gg)
}
dev.off()
img <- image_animate(img, )
image_write(img, "rr.gif")

1
data/RR1826-1911Modified0509161/RR1826-1911Modified050916.cpg

@ -0,0 +1 @@
UTF-8

BIN
data/RR1826-1911Modified0509161/RR1826-1911Modified050916.dbf

Binary file not shown.

1
data/RR1826-1911Modified0509161/RR1826-1911Modified050916.prj

@ -0,0 +1 @@
PROJCS["USA_Contiguous_Albers_Equal_Area_Conic",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Albers"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-96.0],PARAMETER["Standard_Parallel_1",29.5],PARAMETER["Standard_Parallel_2",45.5],PARAMETER["Latitude_Of_Origin",37.5],UNIT["Meter",1.0]]

BIN
data/RR1826-1911Modified0509161/RR1826-1911Modified050916.sbn

Binary file not shown.

BIN
data/RR1826-1911Modified0509161/RR1826-1911Modified050916.sbx

Binary file not shown.

BIN
data/RR1826-1911Modified0509161/RR1826-1911Modified050916.shp

Binary file not shown.

7323
data/RR1826-1911Modified0509161/RR1826-1911Modified050916.shp.xml

File diff suppressed because one or more lines are too long

BIN
data/RR1826-1911Modified0509161/RR1826-1911Modified050916.shx

Binary file not shown.

BIN
data/ne-rr.rds

Binary file not shown.
Loading…
Cancel
Save