forked from CreatingData/Historical-Populations
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.Rhistory
35 lines (35 loc) · 5.44 KB
/
.Rhistory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
data = read_csv("/tmp/Maine.csv")
library(tidyverse)
data = read_csv("/tmp/Maine.csv")
data %>% filter(year > 1850) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop)) + scale_size_sqrt() + facet_wrap(~year)
data %>% filter(year > 1850) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop)) + scale_size_continuous(trans="sqrt") + facet_wrap(~year)
data %>% filter(year == 1850) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop)) + scale_size_continuous(trans="sqrt") + facet_wrap(~year)
data %>% filter(!grepl("County",name)) %>% filter(year == 1850) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop)) + scale_size_continuous(trans="sqrt") + facet_wrap(~year)
data %>% filter(!grepl("County",city)) %>% filter(year == 1850) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop)) + scale_size_continuous(trans="sqrt") + facet_wrap(~year)
data %>% filter(!grepl("County",city)) %>% filter(year == 1850) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop)) + scale_size_continuous(trans="sqrt") + facet_wrap(~year) + coord_map()
install.packages("mapproj")
data %>% filter(!grepl("County",city)) %>% filter(year == 1850) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop)) + scale_size_continuous(trans="sqrt") + facet_wrap(~year) + coord_map()
data %>% filter(!grepl("County",city)) %>% filter(year == 1850) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop),alpha=.33) + scale_size_continuous(trans="sqrt") + facet_wrap(~year) + coord_map()
data %>% filter(!grepl("County",city)) %>% filter(year == 1860) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop),alpha=.33) + scale_size_continuous(trans="sqrt") + facet_wrap(~year) + coord_map()
data %>% filter(!grepl("County",city)) %>% filter(year == 1910) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop),alpha=.33) + scale_size_continuous(trans="sqrt") + facet_wrap(~year) + coord_map()
data %>% filter(!grepl("County",city)) %>% filter(year == 1920) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop),alpha=.33) + scale_size_continuous(trans="sqrt") + facet_wrap(~year) + coord_map()
data %>% filter(!grepl("County",city)) %>% filter(year == 1940) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop),alpha=.33) + scale_size_continuous(trans="sqrt") + facet_wrap(~year) + coord_map()
data %>% filter(!grepl("County",city)) %>% filter(year == 2010) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop),alpha=.33) + scale_size_continuous(trans="sqrt") + facet_wrap(~year) + coord_map()
data %>% filter(grepl("Portland",city))
data %>% filter(!grepl("County",city)) %>% filter(year == 2010) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop),alpha=.33) + scale_size_continuous(trans="sqrt") + facet_wrap(~year) + coord_map()
cube_root = function(x) {return x^1/3}
cube_root = function(x) x^1/3
data %>% filter(!grepl("County",city)) %>% filter(year == 2010) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop),alpha=.33) + scale_size_continuous(trans="cube_root") + facet_wrap(~year) + coord_map()
cube_root_trans = function(x) x^1/3
data %>% filter(!grepl("County",city)) %>% filter(year == 2010) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop),alpha=.33) + scale_size_continuous(trans="cube_root") + facet_wrap(~year) + coord_map()
data %>% filter(!grepl("County",city)) %>% filter(year == 2010) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop),alpha=.33) + scale_size_continuous() + facet_wrap(~year) + coord_map()
data %>% filter(!grepl("County",city)) %>% filter(year == 2010) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop^(1/3)),alpha=.33) + scale_size_continuous() + facet_wrap(~year) + coord_map()
data %>% filter(!grepl("County",city)) %>% filter(year == 2010) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop^(1/3)),alpha=.33) + scale_size_continuous(range=c(.1,5)) + facet_wrap(~year) + coord_map()
data %>% filter(!grepl("County",city)) %>% filter(year == 2010) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop^(1/3)),alpha=.33) + scale_size_continuous(range=c(.1,2)) + facet_wrap(~year) + coord_map()
data %>% filter(!grepl("County",city)) %>% filter(year == 2010) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop^(1/3)),alpha=.33) + scale_size_continuous(range=c(.1,5)) + facet_wrap(~year) + coord_map()
data %>% filter(!grepl("County",city)) %>% filter(year %in% c(1810,1860,1910,1960,2010) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop^(1/3)),alpha=.33) + scale_size_continuous(range=c(.1,5)) + facet_wrap(~year) + coord_map(
data %>% filter(!grepl("County",city)) %>% filter(year %in% c(1810,1860,1910,1960,2010) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop^(1/3)),alpha=.33) + scale_size_continuous(range=c(.1,5)) + facet_wrap(~year) + coord_map()
data %>% filter(!grepl("County",city)) %>% filter(year %in% c(1810,1860,1910,1960,2010) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop^(1/3)),alpha=.33) + scale_size_continuous(range=c(.1,5)) + facet_wrap(~year) + coord_map()
data %>% filter(!grepl("County",city)) %>% filter(year %in% c(1810,1860,1910,1960,2010) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop^(1/3)),alpha=.33) + scale_size_continuous(range=c(.1,5)) + facet_wrap(~year) + coord_map()
data %>% filter(!grepl("County",city)) %>% filter(year %in% c(1810,1860,1910,1960,2010) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop^(1/3)),alpha=.33) + scale_size_continuous(range=c(.1,5)) + facet_wrap(~year) + coord_map()
data %>% filter(!grepl("County",city)) %>% filter(year %in% c(1810,1860,1910,1960,2010)) %>% ggplot() + geom_point(aes(x=lon,y=lat,size=pop^(1/3)),alpha=.33) + scale_size_continuous(range=c(.1,5)) + facet_wrap(~year) + coord_map()