Skip to content

Commit

Permalink
default year in app changed to 2022
Browse files Browse the repository at this point in the history
  • Loading branch information
dicook committed Apr 25, 2023
1 parent e580dd1 commit d4cdb50
Show file tree
Hide file tree
Showing 16 changed files with 49 additions and 43 deletions.
17 changes: 12 additions & 5 deletions R/app.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Shiny app for exploring census and electorate data
#'
#' @param election_year Year of Federal election to be explored (2001, 2004, 2007, 2010, 2013, 2016 or 2019)
#' @param election_year Year of Federal election to be explored (2001, 2004, 2007, 2010, 2013, 2016, 2019, 2022)
#' @param age Age variables to show. Variable(s) should match column names from
#' \link{abs2016}. By default, all variables are shown.
#' @param religion Religion variables to show. Variable(s) should match column
Expand All @@ -17,15 +17,15 @@
#' library(tidyverse)
#' # for comparing labor/liberal
#' launch_app(
#' election_year = 2019,
#' election_year = 2022,
#' age = c("Age20_24", "Age25_34", "Age55_64"),
#' religion = c("Christianity", "Catholic", "NoReligion"),
#' other = c("AusCitizen", "MedianPersonalIncome", "Unemployed")
#' )
#'
#' # for inspecting highly contested areas
#' launch_app(
#' election_year = 2019,
#' election_year = 2022,
#' age = c("Age25_34", "Age35_44", "Age55_64"),
#' religion = c("Christianity", "Catholic", "NoReligion"),
#' other = c("Owned", "Indigenous", "AusCitizen")
Expand All @@ -48,8 +48,8 @@ launch_app <- function(
) {
election_year = as.numeric(election_year)

if (!as.numeric(election_year) %in% c(2001, 2004, 2007, 2010, 2013, 2016, 2019)) {
warning("Election year enter is not valid. Year must be one of 2001, 2004, 2007, 2010, 2013 and 2016.
if (!as.numeric(election_year) %in% c(2001, 2004, 2007, 2010, 2013, 2016, 2019, 2022)) {
warning("Election year enter is not valid. Year must be one of 2001, 2004, 2007, 2010, 2013, 2016, 2019 and 2022.
Using 2016 by default.")
election_year = 2016
}
Expand Down Expand Up @@ -98,6 +98,13 @@ launch_app <- function(
nat_map <- nat_map_download(2019)
abs_data <- as.data.frame(eechidna::abs2019)
}
else if (election_year == 2022) {
fp_data <- as.data.frame(eechidna::fp22)
tcp_data <- as.data.frame(eechidna::tcp22)
nat_data <- nat_data_download(2019)
nat_map <- nat_map_download(2019)
abs_data <- as.data.frame(eechidna::abs2019)
}

# by default, we show parties that won at least 1 electorate
relevantParties <- fp_data %>%
Expand Down
13 changes: 6 additions & 7 deletions man/launch_app.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/nat_data01.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/nat_data04.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/nat_data07.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/nat_data10.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/nat_data13.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/nat_data16.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/nat_data19.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/nat_map01.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/nat_map04.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/nat_map07.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/nat_map10.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/nat_map13.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/nat_map16.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/nat_map19.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d4cdb50

Please sign in to comment.