diff --git a/.gitignore b/.gitignore index ccd23de..8db4e87 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ .Ruserdata .~lock* README.html +fccULSloader/* \ No newline at end of file diff --git a/bin/fcc-query.R b/bin/fcc-query.R new file mode 100644 index 0000000..fcd6486 --- /dev/null +++ b/bin/fcc-query.R @@ -0,0 +1,34 @@ +# Assumes you have https://github.com/tirandagan/fccULSloader installed and +# updated somewhere + +library(dbplyr) +library(RSQLite) +library(dplyr) +library(tidyr) +library(janitor) +library(USAboundaries) + +con <- dbConnect(SQLite(), "fccULSloader/src/data/fcc_data.db") + +am <- tbl(con, "AM") +en <- tbl(con, "EN") + +a <- dbGetQuery(con, "SELECT COUNT(*) FROM EN LEFT JOIN HD ON + EN.unique_system_identifier = HD.unique_system_identifier + WHERE license_status = 'A';") #%>% +#janitor::clean_names() %>% +#head(2) +#filter(status_code == "A") %>% +#summarize(count = n()) #%>% +#collect() + +print(a) + +b <- dbGetQuery(con, "SELECT UPPER(state), COUNT(*) FROM EN LEFT JOIN HD ON + EN.unique_system_identifier = HD.unique_system_identifier + WHERE license_status = 'A' + GROUP BY UPPER(state);") %>% + left_join(state_codes %>% filter(state_abbr != ""), + by = c("UPPER(state)" = "state_abbr")) + +print(b) diff --git a/data/arrl membership over time.csv b/data/arrl membership over time.csv index b600a0b..b073b7b 100644 --- a/data/arrl membership over time.csv +++ b/data/arrl membership over time.csv @@ -21,3 +21,5 @@ Date,Members,source_name,source_detail 2004-12-31,151727,ARRL Annual Report,2004 https://www.arrl.org/files/file/About%20ARRL/Annual-Reportm%202004.pdf 2003-12-31,154545,ARRL Annual Report,2003 https://www.arrl.org/files/file/About%20ARRL/Annual%20Reports/2003%20Annual%20Report.pdf 1993-12-31,170000,W5YI Report,FCC numbers in W5YI Report 1994-04-01 p. 4 +2023-12-31,149501,ARRL Annual Report,https://www.arrl.org/files/file/About%20ARRL/Annual%20Reports/2023%20ARRL%20Annual%20Report.pdf +2024-12-31,137114,ARRL Annual Report,https://www.arrl.org/files/file/About%20ARRL/Annual%20Reports/2024%20ARRL%20Annual%20Report.pdf diff --git a/plots/actions-over-time-2-years.png b/plots/actions-over-time-2-years.png index 03c41f6..c1c4af0 100644 Binary files a/plots/actions-over-time-2-years.png and b/plots/actions-over-time-2-years.png differ diff --git a/plots/arrl-over-time.png b/plots/arrl-over-time.png index 01399cc..9b88ee8 100644 Binary files a/plots/arrl-over-time.png and b/plots/arrl-over-time.png differ diff --git a/plots/cities-over-time.png b/plots/cities-over-time.png index 6d225c1..8ebd967 100644 Binary files a/plots/cities-over-time.png and b/plots/cities-over-time.png differ diff --git a/plots/class-over-time-2-years.png b/plots/class-over-time-2-years.png index 4661bb4..e2649eb 100644 Binary files a/plots/class-over-time-2-years.png and b/plots/class-over-time-2-years.png differ diff --git a/plots/total-over-time-2-months.png b/plots/total-over-time-2-months.png index 7fa21f8..83e67d6 100644 Binary files a/plots/total-over-time-2-months.png and b/plots/total-over-time-2-months.png differ diff --git a/plots/total-over-time-2-years.png b/plots/total-over-time-2-years.png index a34fe6c..50f6515 100644 Binary files a/plots/total-over-time-2-years.png and b/plots/total-over-time-2-years.png differ