Skip to content

Commit

Permalink
filter out holidays with NA date
Browse files Browse the repository at this point in the history
update roxygen version
add url and bug reports to description
add package name and describe in seifa.R
  • Loading branch information
peteowen1 committed Oct 9, 2024
1 parent 0707d69 commit 0bcf037
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 15 deletions.
7 changes: 5 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Maintainer: Will Mackey <[email protected]>
License: GPL-3
Description: This package provides data and functions for working with common structures and classifications used in Australia.
Depends:
R (>= 3.5)
R (>= 3.5)
Imports:
dplyr (>= 0.7),
lifecycle,
Expand All @@ -33,11 +33,14 @@ Imports:
parsedate
Suggests:
testthat,
curl,
sf,
here,
ggplot2,
bench
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
URL: https://runapp-aus.github.io/strayr/
BugReports: https://github.com/runapp-aus/strayr/issues/
RdMacros: lifecycle
18 changes: 9 additions & 9 deletions R/seifa.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
#' \url{https://www.abs.gov.au/statistics/people/people-and-communities/socio-economic-indexes-areas-seifa-australia/2021}

#' @param structure character value for the desired spatial area. Must be one of:
#' \itemize{
#' \describe{
#' \item{sa1}{ - download size 51.6 MB}
#' \item{sa2}{ - download size 1.9 MB}
#' \item{lga}{ - download size 660 KB}
#' \item{postcode}{ - download size 2.3 MB}
#' \item{suburb}{ - download size 11.3 MB}
#' }
#' @param data_subclass character vector matching available SEIFA indexes:
#' \itemize{
#' \describe{
#' \item{irsed}{ - Index of Relative Socio-economic Disadvantage}
#' \item{irsead}{ - Index of Relative Socio-economic Advantage and Disadvantage}
#' \item{ier}{ - Index of Economic Resources}
Expand Down Expand Up @@ -297,18 +297,18 @@ get_seifa_index_sheet <- function(filename, sheetname, structure = c("sa1", "sa2
col_names = column_names,
na = c("", "NA", "-")
) %>%
dplyr::filter(if_all(ends_with(c("_name","_code")), ~ !is.na(.x))) %>%
select(-starts_with("blank")) %>%
mutate(
dplyr::filter(dplyr::if_all(dplyr::ends_with(c("_name","_code")), ~ !is.na(.x))) %>%
dplyr::select(-dplyr::starts_with("blank")) %>%
dplyr::mutate(
structure = structure,
year = year
) %>%
mutate(across(
.cols = any_of(ends_with("_code")), # Specify the column name
dplyr::mutate(dplyr::across(
.cols = dplyr::any_of(ends_with("_code")), # Specify the column name
.fns = ~ as.character(.) # Conditionally convert to character
)) %>%
relocate(structure)
dplyr::relocate(structure)
})

return(df)
}
1 change: 1 addition & 0 deletions data-raw/create_au_holidays.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ raw_data <- package$resources %>%
list_rbind()

auholidays <- raw_data %>%
dplyr::filter(!is.na(Date)) %>% # 'Friday before the AFL Grand Final' not given a date in VIC holiday data
transmute(
Date = ymd(Date),
Name = coalesce(`Holiday Name`),
Expand Down
Binary file modified data/auholidays.rda
Binary file not shown.
4 changes: 2 additions & 2 deletions man/get_seifa.Rd

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

2 changes: 1 addition & 1 deletion man/get_seifa_index_sheet.Rd

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

2 changes: 1 addition & 1 deletion pkgdown/_pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
URL: https://runapp-aus.github.io/strayr/
url: https://runapp-aus.github.io/strayr/

repo:
url:
Expand Down

0 comments on commit 0bcf037

Please sign in to comment.