Init.
This commit is contained in:
commit
5d02dbdba7
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
.Rproj.user
|
||||
.Rhistory
|
||||
.RData
|
||||
.Ruserdata
|
96
bin/data-plots.R
Normal file
96
bin/data-plots.R
Normal file
|
@ -0,0 +1,96 @@
|
|||
|
||||
library(ggplot2)
|
||||
library(tidyr)
|
||||
library(dplyr)
|
||||
library(forcats)
|
||||
library(ggthemes)
|
||||
|
||||
# Read in data from Wayback Machine archive of http://www.arrl.org/fcc-license-counts
|
||||
|
||||
d_raw <- read.csv("data/arrl us ham radio licenses over time.csv")
|
||||
|
||||
# What dates do we have?
|
||||
unique(d_raw$Date)
|
||||
|
||||
# Clean up here if needed
|
||||
d <- d_raw %>%
|
||||
mutate(Date = as.Date(Date)) %>%
|
||||
mutate(across(c(3:9), as.numeric))
|
||||
|
||||
d_total <- d %>% filter(State.Territory == "TOTAL")
|
||||
|
||||
d_total_long <- d_total %>%
|
||||
pivot_longer(cols = 3:9,
|
||||
names_to = "lclass",
|
||||
values_to = "count")
|
||||
|
||||
|
||||
#### Plots ####
|
||||
##### Total over time #####
|
||||
ggplot(data = d_total,
|
||||
aes(x = Date,
|
||||
y = Total)) +
|
||||
geom_line() +
|
||||
geom_point() +
|
||||
scale_x_date(date_breaks = "1 year",
|
||||
date_minor_breaks = "1 month",
|
||||
date_labels = "%Y") +
|
||||
scale_y_continuous(labels = scales::comma) +
|
||||
theme_bw() +
|
||||
labs(title = "US Amateur Licenses",
|
||||
subtitle = "http://www.arrl.org/fcc-license-counts, Wayback Machine",
|
||||
caption = "w1cdn.net")
|
||||
|
||||
##### Total over time, y = 0 #####
|
||||
ggplot(data = d_total,
|
||||
aes(x = Date,
|
||||
y = Total)) +
|
||||
geom_line() +
|
||||
geom_point() +
|
||||
scale_x_date(date_breaks = "1 year",
|
||||
date_minor_breaks = "1 month",
|
||||
date_labels = "%Y") +
|
||||
scale_y_continuous(labels = scales::comma,
|
||||
limits = c(0, NA)) +
|
||||
theme_bw() +
|
||||
labs(title = "US Amateur Licenses",
|
||||
subtitle = "http://www.arrl.org/fcc-license-counts, Wayback Machine",
|
||||
caption = "w1cdn.net")
|
||||
|
||||
##### By license class #####
|
||||
ggplot(data = d_total_long %>% filter(lclass != "Total"),
|
||||
aes(x = Date,
|
||||
y = count,
|
||||
color = fct_reorder2(lclass, Date, count))) +
|
||||
geom_line() +
|
||||
geom_point() +
|
||||
scale_x_date(date_breaks = "1 year",
|
||||
date_minor_breaks = "1 month",
|
||||
date_labels = "%Y") +
|
||||
scale_y_continuous(labels = scales::comma) +
|
||||
scale_color_colorblind() +
|
||||
theme_bw() +
|
||||
labs(title = "US Amateur Licenses by Class",
|
||||
subtitle = "http://www.arrl.org/fcc-license-counts, Wayback Machine",
|
||||
y = "Count",
|
||||
color = "Class",
|
||||
caption = "w1cdn.net")
|
||||
|
||||
##### By license class, stacked #####
|
||||
ggplot(data = d_total_long %>% filter(lclass != "Total"),
|
||||
aes(x = Date,
|
||||
y = count,
|
||||
fill = fct_reorder2(lclass, Date, count))) +
|
||||
geom_area() +
|
||||
scale_fill_colorblind() +
|
||||
scale_x_date(date_breaks = "1 year",
|
||||
date_minor_breaks = "1 month",
|
||||
date_labels = "%Y") +
|
||||
scale_y_continuous(labels = scales::comma) +
|
||||
theme_bw() +
|
||||
labs(title = "US Amateur Licenses by Class",
|
||||
subtitle = "http://www.arrl.org/fcc-license-counts, Wayback Machine",
|
||||
fill = "Class",
|
||||
caption = "w1cdn.net")
|
||||
|
||||
|
1
data/.~lock.arrl us ham radio licenses over time.csv#
Normal file
1
data/.~lock.arrl us ham radio licenses over time.csv#
Normal file
|
@ -0,0 +1 @@
|
|||
Matt Burton-Kelly,Matt,Snug.local,08.01.2024 20:57,file:///Users/Matt/Library/Application%20Support/LibreOffice/4;
|
2969
data/arrl us ham radio licenses over time.csv
Normal file
2969
data/arrl us ham radio licenses over time.csv
Normal file
File diff suppressed because it is too large
Load Diff
13
ham-radio-licenses.Rproj
Normal file
13
ham-radio-licenses.Rproj
Normal file
|
@ -0,0 +1,13 @@
|
|||
Version: 1.0
|
||||
|
||||
RestoreWorkspace: Default
|
||||
SaveWorkspace: Default
|
||||
AlwaysSaveHistory: Default
|
||||
|
||||
EnableCodeIndexing: Yes
|
||||
UseSpacesForTab: Yes
|
||||
NumSpacesForTab: 4
|
||||
Encoding: UTF-8
|
||||
|
||||
RnwWeave: Sweave
|
||||
LaTeX: pdfLaTeX
|
Loading…
Reference in New Issue
Block a user