Add more data and update plots.

Some plots modified a bit more than others. The stacked plot is a mess because of the different license classes, and the color-blind-friendly color scale breaks when there are too many colors.
This commit is contained in:
mattbk committed 2024-01-10 22:06:10 -06:00
1 parent ba5552054b
commit e99aed3617
7 files changed
+3353 -3341

No files matched your search

+4
View File
@@ -4,6 +4,10 @@ Data and code for analysis at https://mastodon.radio/@W1CDN/111723969200676208.
I'll get a blog post up at https://w1cdn.net at some point. I'll get a blog post up at https://w1cdn.net at some point.
This is a work in progress. It is not intended to be immediately useful for
detailed analysis, but to act as a guide for further investigation. As we figure out
how to slice up and caveat data, it will get more organized.
# Resources (not all integrated yet) # Resources (not all integrated yet)
- Various items in the [issue queue](https://amiok.net/gitea/W1CDN/ham-radio-licenses/issues) - Various items in the [issue queue](https://amiok.net/gitea/W1CDN/ham-radio-licenses/issues)
- Post from KE9V that started this: https://mastodon.sdf.org/@jdavis/111720350879036543 - Post from KE9V that started this: https://mastodon.sdf.org/@jdavis/111720350879036543
+26 -26
View File
@@ -4,6 +4,8 @@ library(tidyr)
library(dplyr) library(dplyr)
library(forcats) library(forcats)
library(ggthemes) library(ggthemes)
library(plotly)
library(htmlwidgets)
# Read in data from Wayback Machine archive of http://www.arrl.org/fcc-license-counts # Read in data from Wayback Machine archive of http://www.arrl.org/fcc-license-counts
@@ -16,39 +18,18 @@ unique(d_raw$Date)
d <- d_raw %>% d <- d_raw %>%
mutate(Date = as.Date(Date)) %>% mutate(Date = as.Date(Date)) %>%
# Drop Tech alone and leave Tech and Tech Plus # Drop Tech alone and leave Tech and Tech Plus
select(-c(Tech, Tech.Plus)) %>% select(-c(Tech, Tech.Plus))
mutate(across(c(3:8), as.numeric))
d_total <- d %>% filter(State.Territory == "TOTAL") d_total <- d %>% filter(State.Territory == "TOTAL")
d_total_long <- d_total %>% d_total_long <- d_total %>%
pivot_longer(cols = 3:8, pivot_longer(cols = !c("Date", "State.Territory", "source_name", "source_detail"),
names_to = "lclass", names_to = "lclass",
values_to = "count") %>% values_to = "count") %>%
# only keep rows with data so plots look right # only keep rows with data so plots look right
filter(!is.na(count)) filter(!is.na(count))
#### Plots #### #### Plots ####
##### Total over time #####
ggplot(data = d_total,
aes(x = Date,
y = Total,
color = source_name)) +
geom_line() +
geom_point(size = 0.3) +
scale_x_date(date_breaks = "10 years",
date_minor_breaks = "1 year",
date_labels = "%Y") +
scale_y_continuous(labels = scales::comma) +
theme_bw() +
labs(title = "US Amateur Licenses",
subtitle = "ARRL, AH0A",
caption = "w1cdn.net",
color = "Source") +
theme(legend.position="bottom")
ggsave("plots/total-over-time.png", width = 6, height = 4)
##### Total over time, y = 0 ##### ##### Total over time, y = 0 #####
ggplot(data = d_total, ggplot(data = d_total,
@@ -64,13 +45,34 @@ ggplot(data = d_total,
limits = c(0, NA)) + limits = c(0, NA)) +
theme_bw() + theme_bw() +
labs(title = "US Amateur Licenses", labs(title = "US Amateur Licenses",
subtitle = "ARRL, AH0A",
caption = "w1cdn.net", caption = "w1cdn.net",
color = "Source") + color = "Source") +
theme(legend.position="bottom") theme(legend.position="bottom")
ggsave("plots/total-over-time-y.png", width = 6, height = 4) ggsave("plots/total-over-time-y.png", width = 6, height = 4)
p <- ggplotly()
htmlwidgets::saveWidget(as_widget(p), selfcontained = TRUE, file = "plots/total-over-time-y.html")
##### Total over time, since 2000 #####
ggplot(data = d_total %>% filter(Date >= as.Date("2000-01-01")),
aes(x = Date,
y = Total,
color = source_name)) +
geom_line() +
geom_point(size = 0.3) +
scale_x_date(date_breaks = "1 years",
date_minor_breaks = "3 months",
date_labels = "%Y") +
scale_y_continuous(labels = scales::comma) +
theme_bw() +
labs(title = "US Amateur Licenses since 2000",
caption = "w1cdn.net",
color = "Source") +
theme(legend.position="bottom")
ggsave("plots/total-over-time.png", width = 6, height = 4)
##### By license class ##### ##### By license class #####
ggplot(data = d_total_long %>% filter(lclass != "Total"), ggplot(data = d_total_long %>% filter(lclass != "Total"),
aes(x = Date, aes(x = Date,
@@ -85,7 +87,6 @@ ggplot(data = d_total_long %>% filter(lclass != "Total"),
scale_color_colorblind() + scale_color_colorblind() +
theme_bw() + theme_bw() +
labs(title = "US Amateur Licenses by Class", labs(title = "US Amateur Licenses by Class",
subtitle = "ARRL, AH0A",
y = "Count", y = "Count",
color = "Class", color = "Class",
caption = "w1cdn.net") + caption = "w1cdn.net") +
@@ -106,7 +107,6 @@ ggplot(data = d_total_long %>% filter(lclass != "Total"),
scale_y_continuous(labels = scales::comma) + scale_y_continuous(labels = scales::comma) +
theme_bw() + theme_bw() +
labs(title = "US Amateur Licenses by Class", labs(title = "US Amateur Licenses by Class",
subtitle = "ARRL, AH0A",
fill = "Class", fill = "Class",
caption = "w1cdn.net") + caption = "w1cdn.net") +
theme(legend.position="bottom") theme(legend.position="bottom")
File diff suppressed because it is too large. Load diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 KiB

After

Width:  |  Height:  |  Size: 224 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-d06007a5a94da181c724" class="plotly html-widget" style="width:100%;height:400px;"> <div id="htmlwidget-b6ba6adabc3e097370de" class="plotly html-widget" style="width:100%;height:400px;">
</div> </div>
</div> </div>
<script type="application/json" data-for="htmlwidget-d06007a5a94da181c724">{"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-b6ba6adabc3e097370de">{"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-d06007a5a94da181c724">{"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-b6ba6adabc3e097370de">{"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: 164 KiB

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

After

Width:  |  Height:  |  Size: 168 KiB