Add a bit more data, update plots.

This commit is contained in:
mattbk 2024-01-22 22:31:45 -06:00
parent 694ca425a3
commit 0b7e9db564
7 changed files with 68 additions and 5 deletions

View File

@ -7,9 +7,10 @@ library(ggthemes)
library(plotly)
library(htmlwidgets)
library(lubridate)
library(ggrepel)
# Read in data from Wayback Machine archive of http://www.arrl.org/fcc-license-counts
#### Total/State/Class ####
# Read in total/state/class data
d_raw <- read.csv("data/us ham radio licenses over time.csv")
# What dates do we have?
@ -34,6 +35,11 @@ d_state_total_long <- d %>% filter(State.Territory != "TOTAL") %>%
select(Date, State.Territory, Total, source_name, source_detail) %>%
filter(!is.na(Total))
#### City ####
city_raw <- read.csv("data/us cities ham radio licenses over time.csv")
city <- city_raw %>% mutate(Date = as.Date(Date),
city_label = paste0(City, ", ", State))
#### Plots ####
##### Total over time, y = 0 #####
@ -200,3 +206,54 @@ ggplot(data = d_state_total_long,
theme(legend.position="bottom")
ggsave("plots/states-over-time-freey.png", width = 15, height = 9)
##### By city #####
a <- city %>% group_by(city_label) %>%
mutate(plot_label = if_else(Date == max(Date),
city_label,
NA_character_))
ggplot(data = a,
aes(x = Date,
y = Count,
color = city_label)) +
geom_line() +
geom_point(size = 0.3) +
scale_x_date(date_breaks = "1 years",
date_minor_breaks = "1 month",
date_labels = "%Y",
limits = c(NA_Date_, Sys.Date() + years(4))) +
scale_y_continuous(labels = scales::comma) +
theme_bw() +
geom_label_repel(aes(label = plot_label),
nudge_x = 1,
na.rm = TRUE,
segment.colour = NA) +
labs(title = "US Amateur Licenses by City",
y = "Count",
caption = "w1cdn.net") +
theme(legend.position="bottom") +
guides(color = "none")
ggsave("plots/cities-over-time.png", width = 15, height = 9)
##### By city, free y #####
ggplot(data = city,
aes(x = Date,
y = Count,
group = city_label)) +
geom_line() +
geom_point(size = 0.3) +
facet_wrap(~city_label,
scales = "free_y"
) +
scale_x_date(date_breaks = "4 years",
date_minor_breaks = "1 years",
date_labels = "%Y") +
scale_y_continuous(labels = scales::comma) +
theme_bw() +
labs(title = "US Amateur Licenses by City",
y = "Count",
caption = "w1cdn.net") +
theme(legend.position="bottom")
ggsave("plots/cities-over-time-freey.png", width = 15, height = 9)

View File

@ -4255,3 +4255,9 @@ Date,State/Territory,Novice,Tech,Tech-Plus,General,Advanced,Extra,Total,Tech_and
2024-01-20,Wyoming,10,1027,,652,110,478,2277,,,,,,,,ARRL FCC License Counts,https://web.archive.org/web/20240122150020/https://www.arrl.org/fcc-license-counts
2024-01-20,Other*,1,281,,97,6,195,580,,,,,,,,ARRL FCC License Counts,https://web.archive.org/web/20240122150020/https://www.arrl.org/fcc-license-counts
2024-01-20,TOTAL,5823,374628,,186774,32189,155170,754584,,,,,,,,ARRL FCC License Counts,https://web.archive.org/web/20240122150020/https://www.arrl.org/fcc-license-counts
1986-02-28,TOTAL,79028,84478,,117407,98357,38931,418201,,,,,,,,FCC-W5YI,FCC numbers in W5YI Report 1989-04-01 p. 6
1987-02-28,TOTAL,81445,85913,,11535,97727,41462,422082,,,,,,,,FCC-W5YI,FCC numbers in W5YI Report 1989-04-01 p. 6
1988-02-28,TOTAL,82390,94361,,113949,98408,44205,433313,,,,,,,,FCC-W5YI,FCC numbers in W5YI Report 1989-04-01 p. 6
1989-02-28,TOTAL,81092,104113,,114256,99491,47500,446452,,,,,,,,FCC-W5YI,FCC numbers in W5YI Report 1989-04-01 p. 6
1989-03-31,TOTAL,82259,105002,,114606,99811,47734,449412,,,,,,,,FCC-W5YI,FCC numbers in W5YI Report 1989-05-15 p. 6
1989-04-30,TOTAL,83371,106341,,114975,100183,48049,452919,,,,,,,,FCC-W5YI,FCC numbers in W5YI Report 1989-06-15 p. 7

Can't render this file because it is too large.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 577 KiB

After

Width:  |  Height:  |  Size: 578 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 KiB

After

Width:  |  Height:  |  Size: 240 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 174 KiB