More work on AE7Q.
This commit is contained in:
@ -43,7 +43,10 @@ city <- city_raw %>% mutate(Date = as.Date(Date),
|
||||
#### License Actions ####
|
||||
ae7q_actions <- read.csv("data/ae7q-actions-scraped.csv") %>%
|
||||
mutate(date = as.Date(date)) %>%
|
||||
filter(!is.na(action))
|
||||
filter(!is.na(action)) %>%
|
||||
arrange(date) %>%
|
||||
group_by(action) %>%
|
||||
mutate(mean_30 = rollmean(count, k=30, fill=NA, align='right'))
|
||||
|
||||
#### Plots ####
|
||||
|
||||
@ -295,16 +298,21 @@ ggplot(data = ae7q_actions,
|
||||
y = count,
|
||||
color = action)) +
|
||||
geom_line() +
|
||||
scale_x_date(date_breaks = "1 month",
|
||||
date_minor_breaks = "1 week",
|
||||
date_labels = "%Y-%m-%d") +
|
||||
geom_line(data = ae7q_actions,
|
||||
aes(x = date,
|
||||
y = mean_30),
|
||||
color = "black") +
|
||||
scale_x_date(date_breaks = "5 years",
|
||||
date_minor_breaks = "1 year",
|
||||
date_labels = "%Y") +
|
||||
facet_wrap(~action,
|
||||
scales = "free_y") +
|
||||
theme_bw() +
|
||||
labs(title = "US Amateur License Actions",
|
||||
subtitle = "with 30-day rolling mean",
|
||||
y = "Count",
|
||||
x = "Date",
|
||||
caption = "w1cdn.net",
|
||||
caption = "w1cdn.net; source: ae7q.com",
|
||||
color = "Action") +
|
||||
guides(color = "none")
|
||||
|
||||
|
Reference in New Issue
Block a user