No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

122 líneas
7.6KB

  1. election_dates <- function() {
  2. tibble::tribble(
  3. ~ date, ~ description, ~ source,
  4. "03/05/2024", "2024 Primary", "https://www.ncsbe.gov/campaign-finance/reporting-schedules",
  5. "11/05/2024", "2024 General", "https://www.ncsbe.gov/campaign-finance/reporting-schedules",
  6. "05/17/2022", "2022 Primary", "https://web.archive.org/web/20221110183405/https://www.ncsbe.gov/campaign-finance/reporting-schedules",
  7. "11/08/2022", "2022 General", "https://web.archive.org/web/20221110183405/https://www.ncsbe.gov/campaign-finance/reporting-schedules",
  8. "3/03/2020", "2020 Primary", "https://web.archive.org/web/20200126233324/https://www.ncsbe.gov/index.html",
  9. "11/03/2020", "2020 General", "https://en.wikipedia.org/wiki/2020_United_States_presidential_election_in_North_Carolina",
  10. "05/08/2018", "2018 Primary", "https://web.archive.org/web/20181223144944/https://www.ncsbe.gov/Elections",
  11. "11/06/2018", "2018 General", "https://web.archive.org/web/20181223144944/https://www.ncsbe.gov/Elections",
  12. "03/15/2016", "2016 Primary", "https://web.archive.org/web/20160131011839/http://www.ncsbe.gov/Elections/Election-Information",
  13. "11/08/2016" ,"2016 General", "https://web.archive.org/web/20160131011839/http://www.ncsbe.gov/Elections/Election-Information"
  14. ) |>
  15. mutate(date = mdy(date))
  16. }
  17. reporting_schedule <- function() {
  18. list(
  19. "2023" =
  20. # https://www.ncsbe.gov/campaign-finance/reporting-schedules
  21. tibble::tribble(
  22. ~Report.Year, ~Report.Name, ~Report.Start.Date, ~Report.End.Date, ~Report.Due.Date,
  23. 2023L, "Mid-Year Semi-Annual", "01/01/2023", "06/30/2023", "07/28/2023",
  24. 2023L, "Year-End Semi-Annual", "07/01/2023", "12/31/2023", "01/26/2024",
  25. 2024L, "First Quarter Plus", "01/01/2024", "02/17/2024", "02/27/2024",
  26. 2024L, "Second Quarter", "02/18/2024", "06/30/2024", "07/10/2024",
  27. 2024L, "Third Quarter Plus", "07/01/2024", "10/19/2024", "10/29/2024",
  28. 2024L, "Fourth Quarter", "10/20/2024", "12/31/2024", "01/10/2025",
  29. 2024L, "Mid-year Semi-Annual*", "01/01/2024", "06/30/2024", "07/26/2024",
  30. 2024L, "Year-End Semi-Annual*", "07/01/2024", "12/31/2024", "01/31/2025"
  31. ),
  32. "2021" =
  33. # https://web.archive.org/web/20210823183129/https://www.ncsbe.gov/campaign-finance/reporting-schedules
  34. tibble::tribble(
  35. ~Report.Year, ~Report.Name, ~Report.Start.Date, ~Report.End.Date, ~Report.Due.Date,
  36. 2021L, "Mid-Year Semiannual", "01/01/2021", "06/30/2021", "07/30/2021",
  37. 2021L, "Year-End Semiannual", "07/01/2021", "12/31/2021", "01/28/2022"
  38. ),
  39. "2022" =
  40. # https://web.archive.org/web/20221110183405/https://www.ncsbe.gov/campaign-finance/reporting-schedules
  41. tibble::tribble(
  42. ~Report.Year, ~Report.Name, ~Report.Start.Date, ~Report.End.Date, ~Report.Due.Date,
  43. 2022L, "First Quarter Plus", "01/01/2022", "04/30/2022", "05/10/2022",
  44. 2022L, "Second Quarter", "05/01/2022", "06/30/2022", "07/12/2022",
  45. 2022L, "Third Quarter Plus", "07/01/2022", "10/22/2022", "11/01/2022",
  46. 2022L, "Fourth Quarter", "10/23/2022", "12/31/2022", "01/11/2023",
  47. 2022L, "Mid-Year Semiannual*", "01/01/2022", "06/30/2022", "07/29/2022",
  48. 2022L, "Year-End Semiannual*", "07/01/2022", "12/31/2022", "01/27/2023"
  49. ),
  50. "2020" =
  51. # https://web.archive.org/web/20201228050159/https://www.ncsbe.gov/campaign-finance/reporting-schedules
  52. tibble::tribble(
  53. ~Report.Year, ~Report.Name, ~Report.Start.Date, ~Report.End.Date, ~Report.Due.Date,
  54. 2019L, "Mid-Year Semiannual", "1/1/2019", "6/30/2019", "7/26/2019",
  55. 2019L, "Year-End Semiannual", "7/1/2019", "12/31/2019", "1/31/2020",
  56. 2020L, "First Quarter Plus", "1/1/2020", "2/15/2020", "2/25/2020",
  57. 2020L, "Second Quarter", "2/16/2020", "6/30/2020", "7/10/2020",
  58. 2020L, "Third Quarter Plus", "7/1/2020", "10/17/2020", "10/27/2020",
  59. 2020L, "Fourth Quarter", "10/18/2020", "12/31/2020", "1/12/2021",
  60. 2020L, "Mid-Year Semi-Annual*", "1/1/2020", "6/30/2020", "7/31/2020",
  61. 2020L, "Year-End Semi-Annual*", "7/1/2020", "12/31/2020", "1/29/2021"
  62. ),
  63. "2018" =
  64. # https://web.archive.org/web/20181223145312/https://www.ncsbe.gov/campaign-finance/reporting-schedules
  65. tibble::tribble(
  66. ~Report.Year, ~Report.Name, ~Report.Start.Date, ~Report.End.Date, ~Report.Due.Date,
  67. 2018L, "First Quarter Plus", "1/1/2018", "4/21/2018", "4/30/2018",
  68. 2018L, "Second Quarter", "4/22/2018", "6/30/2018", "7/11/2018",
  69. 2018L, "Mid Year Semi Annual*", "1/1/2018", "6/30/2018", "7/27/2018",
  70. 2018L, "Third Quarter Plus", "7/1/2018", "10/20/2018", "10/29/2018",
  71. 2018L, "Fourth Quarter", "10/21/2018", "12/31/2018", "1/10/2019",
  72. 2018L, "Year End Semi Annual*", "7/1/2018", "12/31/2018", "1/25/2019",
  73. 2019L, "Mid Year Semi Annual", "1/1/2019", "6/30/2019", "7/26/2019",
  74. 2019L, "Year End Semi Annual", "7/1/2019", "12/31/2019", "1/31/2020"
  75. ),
  76. "2017" =
  77. # https://web.archive.org/web/20170219143056/https://www.ncsbe.gov/campaign-finance/reporting-schedules
  78. tibble::tribble(
  79. ~Report.Year, ~Report.Name, ~Report.Start.Date, ~Report.End.Date, ~Report.Due.Date,
  80. 2017L, "Mid Year Semi Annual", "1/1/2017", "6/30/2017", "7/28/2017",
  81. 2017L, "Year End Semi Annual", "7/1/2017", "12/31/2017", "1/26/2018",
  82. ),
  83. "2016" =
  84. # https://web.archive.org/web/20160201011756/https://www.ncsbe.gov/campaign-finance/reporting-schedules
  85. tibble::tribble(
  86. ~Report.Year, ~Report.Name, ~Report.Start.Date, ~Report.End.Date, ~Report.Due.Date,
  87. 2015L, "Year End Semi Annual", "7/1/2015", "12/31/2015", "1/29/2016",
  88. 2016L, "First Quarter", "1/1/2016", "2/29/2016", "3/7/2016",
  89. 2016L, "Second Quarter", "3/1/2016", "6/30/2016", "7/12/2016",
  90. 2016L, "Mid Year Semi Annual*", "1/1/2016", "6/30/2016", "7/29/2016",
  91. 2016L, "Third Quarter", "7/1/2016", "10/22/2016", "10/31/2016",
  92. 2016L, "Fourth Quarter", "10/23/2016", "12/31/2016", "1/11/2017",
  93. 2016L, "Year End Semi Annual*", "7/1/2016", "12/31/2016", "1/27/2017"
  94. )
  95. ) |>
  96. list_rbind() |>
  97. set_names(c("year", "doc_name", "sboe_start_date", "sboe_end_date", "sboe_due_date")) |>
  98. type_convert(
  99. col_types = cols(
  100. doc_name = col_character(),
  101. sboe_start_date = col_date(format = "%m/%d/%Y"),
  102. sboe_end_date = col_date(format = "%m/%d/%Y"),
  103. sboe_due_date = col_date(format = "%m/%d/%Y")
  104. )
  105. ) |>
  106. mutate(
  107. sboe_alt = stringr::str_detect(doc_name, "[*]$"),
  108. doc_name = doc_name |>
  109. stringr::str_replace("Mid-[Yy]ear", "Mid Year") |>
  110. stringr::str_replace("Year-End", "Year End") |>
  111. stringr::str_replace("[Ss]emi ?[Aa]nnual", "Semi-Annual") |>
  112. stringr::str_remove(" Plus") |>
  113. stringr::str_remove("[*]")
  114. ) |>
  115. distinct()
  116. }