Add a bit more data, update plots.

This commit is contained in:
mattbk committed 2024-01-22 22:31:45 -06:00
1 parent 694ca425a3
commit 0b7e9db564
7 files changed
+68 -5

No files matched your search

+59 -2
View File
@@ -7,9 +7,10 @@ library(ggthemes)
library(plotly) library(plotly)
library(htmlwidgets) library(htmlwidgets)
library(lubridate) 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") d_raw <- read.csv("data/us ham radio licenses over time.csv")
# What dates do we have? # What dates do we have?
@@ -33,6 +34,11 @@ d_total_long <- d_total %>%
d_state_total_long <- d %>% filter(State.Territory != "TOTAL") %>% d_state_total_long <- d %>% filter(State.Territory != "TOTAL") %>%
select(Date, State.Territory, Total, source_name, source_detail) %>% select(Date, State.Territory, Total, source_name, source_detail) %>%
filter(!is.na(Total)) 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 #### #### Plots ####
@@ -200,3 +206,54 @@ ggplot(data = d_state_total_long,
theme(legend.position="bottom") theme(legend.position="bottom")
ggsave("plots/states-over-time-freey.png", width = 15, height = 9) 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)
+6
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,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,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 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

+3 -3
View File
@@ -1942,11 +1942,11 @@ var n,i=t("./lib/build-log"),a=t("./lib/epsilon"),o=t("./lib/intersecter"),s=t("
</head> </head>
<body style="background-color: white;"> <body style="background-color: white;">
<div id="htmlwidget_container"> <div id="htmlwidget_container">
<div id="htmlwidget-150feb5bfd58c8800445" class="plotly html-widget" style="width:100%;height:400px;"> <div id="htmlwidget-dd6e6c4c5308c3cea86c" class="plotly html-widget" style="width:100%;height:400px;">
</div> </div>
</div> </div>
<script type="application/json" data-for="htmlwidget-150feb5bfd58c8800445">{"x":{"data":[{"x":[10013,10043,10074,10105,10135,10166,10196,10227,10258,10286,10317,10347,10378,10408,10439,10470,10500,10531,10561,10592,10623,10651,10682,10712,10743,10773,10804,10835,10865,10896,10926,10957,10988,11017,11048,11078,11109,11139,11170,11201,11231,11262,11292,11323,11354,11382,11413,11443,11474,11504,11535,11566,11596,11627,11657,11688,11719,11747,11778,11808,11839,11869,11900,11931,11961,11992,12022,12053,12084,12112,12143,12173,12204,12234,12265,12296,12326,12357,12387,12418,12449,12478,12509,12539,12570,12600,12631,12662,12692,12723,12753,12784,12815,12843,12874,12904,12935,12965,12996,13027,13057,13088,13118,13149,13180,13208,13239,13269,13300,13330,13361,13392,13422,13453,13483,13514,13545,13573,13604,13634,13665,13695,13726,13757,13787,13818,13848,13879,13910,13939,13970,14000,14031,14061,14092,14123,14153,14184,14214,14245,14276,14304,14335,14365,14396,14426,14457,14488,14518,14549,14579,14610,14641,14669,14700,14730,14761,14791,14822,14853,14883,14914,14944,14975,15006,15034,15065,15095,15126,15156,15187,15218,15248,15279,15309,15340,15371,15400,15431,15461,15492,15522,15553,15584,15614,15645,15675,15706,15737,15765,15796,15826,15857,15887,15918,15949,15979,16010,16040,16071,16102,16130,16161,16191,16222,16252,16283,16314,16344,16375,16405,16436,16467,16495,16526,16556,16587,16617,16648,16679,16709,16740,16770,16801,16832,16861,16892,16922,16953,16983,17014,17045,17075,17106,17136,17167,17198,17226,17257,17287,17318,17348,17379,17410,17440,17471,17501,17532,17563,17591,17622,17652,17683,17713,17744,17775,17805,17836,17866,17897],"y":[678473,678733,678320,676995,677137,677514,676506,676809,676028,674767,675104,673973,674080,673402,672919,672678,673062,672783,673823,672833,673403,674719,675529,675376,676000,676318,676021,675941,676187,676766,677392,676718,676846,677784,678539,677349,679273,678921,680570,680972,681182,682163,682240,682602,683794,684359,683952,683790,684310,683061,682790,682933,682627,682512,683037,683350,683157,683180,683165,684235,683146,682752,683351,683257,684498,685302,685308,685037,685077,685437,687860,687055,686406,687104,685823,683831,683850,683897,684059,683274,683271,683117,682913,680703,682164,675644,675855,674297,672704,672622,671837,669744,668908,667876,666746,665533,665088,664260,663783,663888,663599,662353,662600,660943,660122,660089,658832,659499,658042,657335,657306,656727,658454,656831,656068,656266,655477,655048,654940,655565,654695,654899,655958,655855,656501,656047,655842,655952,656730,656752,658516,658272,658711,659966,659984,660323,661591,662532,663564,664272,665497,668307,669818,670965,672415,674101,675844,678081,679441,681114,682497,683583,685294,688666,690446,691982,694346,694119,694206,694891,694991,695397,696041,696302,696485,698047,698074,698410,699737,699399,699707,700221,700314,701844,702056,701969,703822,704236,704676,706131,705512,705530,706592,706681,707972,709291,709575,710166,710966,711742,713732,713697,712922,714498,714730,715483,715392,716672,717201,718126,719522,720076,723182,723186,725216,723755,724532,723771,724926,726006,726275,727957,727354,728146,730283,729685,729683,730454,730610,731974,732884,733594,735405,735023,736145,737135,738186,739238,739820,739694,739568,740784,742170,743003,742787,742652,742518,743806,743151,743523,743894,743823,744882,745201,745628,747994,748136,747349,749641,749711,750097,752142,752548,752559,753054,753549,753931,754681,755430,755952],"text":["Date: 1997-06-01<br />Total: 678473<br />source_name: AH0A","Date: 1997-07-01<br />Total: 678733<br />source_name: AH0A","Date: 1997-08-01<br />Total: 678320<br />source_name: AH0A","Date: 1997-09-01<br />Total: 676995<br />source_name: AH0A","Date: 1997-10-01<br />Total: 677137<br />source_name: AH0A","Date: 1997-11-01<br />Total: 677514<br />source_name: AH0A","Date: 1997-12-01<br />Total: 676506<br />source_name: AH0A","Date: 1998-01-01<br />Total: 676809<br />source_name: AH0A","Date: 1998-02-01<br />Total: 676028<br />source_name: AH0A","Date: 1998-03-01<br />Total: 674767<br />source_name: AH0A","Date: 1998-04-01<br />Total: 675104<br />source_name: AH0A","Date: 1998-05-01<br />Total: 673973<br />source_name: AH0A","Date: 1998-06-01<br />Total: 674080<br />source_name: AH0A","Date: 1998-07-01<br />Total: 673402<br />source_name: AH0A","Date: 1998-08-01<br />Total: 672919<br />source_name: AH0A","Date: 1998-09-01<br />Total: 672678<br />source_name: AH0A","Date: 1998-10-01<br />Total: 673062<br />source_name: AH0A","Date: 1998-11-01<br />Total: 672783<br />source_name: AH0A","Date: 1998-12-01<br />Total: 673823<br />source_name: AH0A","Date: 1999-01-01<br />Total: 672833<br />source_name: AH0A","Date: 1999-02-01<br />Total: 673403<br />source_name: AH0A","Date: 1999-03-01<br />Total: 674719<br />source_name: AH0A","Date: 1999-04-01<br />Total: 675529<br />source_name: AH0A","Date: 1999-05-01<br />Total: 675376<br />source_name: AH0A","Date: 1999-06-01<br />Total: 676000<br />souLine truncated <script type="application/json" data-for="htmlwidget-dd6e6c4c5308c3cea86c">{"x":{"data":[{"x":[10013,10043,10074,10105,10135,10166,10196,10227,10258,10286,10317,10347,10378,10408,10439,10470,10500,10531,10561,10592,10623,10651,10682,10712,10743,10773,10804,10835,10865,10896,10926,10957,10988,11017,11048,11078,11109,11139,11170,11201,11231,11262,11292,11323,11354,11382,11413,11443,11474,11504,11535,11566,11596,11627,11657,11688,11719,11747,11778,11808,11839,11869,11900,11931,11961,11992,12022,12053,12084,12112,12143,12173,12204,12234,12265,12296,12326,12357,12387,12418,12449,12478,12509,12539,12570,12600,12631,12662,12692,12723,12753,12784,12815,12843,12874,12904,12935,12965,12996,13027,13057,13088,13118,13149,13180,13208,13239,13269,13300,13330,13361,13392,13422,13453,13483,13514,13545,13573,13604,13634,13665,13695,13726,13757,13787,13818,13848,13879,13910,13939,13970,14000,14031,14061,14092,14123,14153,14184,14214,14245,14276,14304,14335,14365,14396,14426,14457,14488,14518,14549,14579,14610,14641,14669,14700,14730,14761,14791,14822,14853,14883,14914,14944,14975,15006,15034,15065,15095,15126,15156,15187,15218,15248,15279,15309,15340,15371,15400,15431,15461,15492,15522,15553,15584,15614,15645,15675,15706,15737,15765,15796,15826,15857,15887,15918,15949,15979,16010,16040,16071,16102,16130,16161,16191,16222,16252,16283,16314,16344,16375,16405,16436,16467,16495,16526,16556,16587,16617,16648,16679,16709,16740,16770,16801,16832,16861,16892,16922,16953,16983,17014,17045,17075,17106,17136,17167,17198,17226,17257,17287,17318,17348,17379,17410,17440,17471,17501,17532,17563,17591,17622,17652,17683,17713,17744,17775,17805,17836,17866,17897],"y":[678473,678733,678320,676995,677137,677514,676506,676809,676028,674767,675104,673973,674080,673402,672919,672678,673062,672783,673823,672833,673403,674719,675529,675376,676000,676318,676021,675941,676187,676766,677392,676718,676846,677784,678539,677349,679273,678921,680570,680972,681182,682163,682240,682602,683794,684359,683952,683790,684310,683061,682790,682933,682627,682512,683037,683350,683157,683180,683165,684235,683146,682752,683351,683257,684498,685302,685308,685037,685077,685437,687860,687055,686406,687104,685823,683831,683850,683897,684059,683274,683271,683117,682913,680703,682164,675644,675855,674297,672704,672622,671837,669744,668908,667876,666746,665533,665088,664260,663783,663888,663599,662353,662600,660943,660122,660089,658832,659499,658042,657335,657306,656727,658454,656831,656068,656266,655477,655048,654940,655565,654695,654899,655958,655855,656501,656047,655842,655952,656730,656752,658516,658272,658711,659966,659984,660323,661591,662532,663564,664272,665497,668307,669818,670965,672415,674101,675844,678081,679441,681114,682497,683583,685294,688666,690446,691982,694346,694119,694206,694891,694991,695397,696041,696302,696485,698047,698074,698410,699737,699399,699707,700221,700314,701844,702056,701969,703822,704236,704676,706131,705512,705530,706592,706681,707972,709291,709575,710166,710966,711742,713732,713697,712922,714498,714730,715483,715392,716672,717201,718126,719522,720076,723182,723186,725216,723755,724532,723771,724926,726006,726275,727957,727354,728146,730283,729685,729683,730454,730610,731974,732884,733594,735405,735023,736145,737135,738186,739238,739820,739694,739568,740784,742170,743003,742787,742652,742518,743806,743151,743523,743894,743823,744882,745201,745628,747994,748136,747349,749641,749711,750097,752142,752548,752559,753054,753549,753931,754681,755430,755952],"text":["Date: 1997-06-01<br />Total: 678473<br />source_name: AH0A","Date: 1997-07-01<br />Total: 678733<br />source_name: AH0A","Date: 1997-08-01<br />Total: 678320<br />source_name: AH0A","Date: 1997-09-01<br />Total: 676995<br />source_name: AH0A","Date: 1997-10-01<br />Total: 677137<br />source_name: AH0A","Date: 1997-11-01<br />Total: 677514<br />source_name: AH0A","Date: 1997-12-01<br />Total: 676506<br />source_name: AH0A","Date: 1998-01-01<br />Total: 676809<br />source_name: AH0A","Date: 1998-02-01<br />Total: 676028<br />source_name: AH0A","Date: 1998-03-01<br />Total: 674767<br />source_name: AH0A","Date: 1998-04-01<br />Total: 675104<br />source_name: AH0A","Date: 1998-05-01<br />Total: 673973<br />source_name: AH0A","Date: 1998-06-01<br />Total: 674080<br />source_name: AH0A","Date: 1998-07-01<br />Total: 673402<br />source_name: AH0A","Date: 1998-08-01<br />Total: 672919<br />source_name: AH0A","Date: 1998-09-01<br />Total: 672678<br />source_name: AH0A","Date: 1998-10-01<br />Total: 673062<br />source_name: AH0A","Date: 1998-11-01<br />Total: 672783<br />source_name: AH0A","Date: 1998-12-01<br />Total: 673823<br />source_name: AH0A","Date: 1999-01-01<br />Total: 672833<br />source_name: AH0A","Date: 1999-02-01<br />Total: 673403<br />source_name: AH0A","Date: 1999-03-01<br />Total: 674719<br />source_name: AH0A","Date: 1999-04-01<br />Total: 675529<br />source_name: AH0A","Date: 1999-05-01<br />Total: 675376<br />source_name: AH0A","Date: 1999-06-01<br />Total: 676000<br />souLine truncated
<script type="application/htmlwidget-sizing" data-for="htmlwidget-150feb5bfd58c8800445">{"viewer":{"width":"100%","height":400,"padding":0,"fill":true},"browser":{"width":"100%","height":400,"padding":0,"fill":true}}</script> <script type="application/htmlwidget-sizing" data-for="htmlwidget-dd6e6c4c5308c3cea86c">{"viewer":{"width":"100%","height":400,"padding":0,"fill":true},"browser":{"width":"100%","height":400,"padding":0,"fill":true}}</script>
</body> </body>
</html> </html>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 174 KiB