Skip to content

Commit

Permalink
Merge branch 'development' into fix_pkgdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Jennit07 committed Sep 26, 2023
2 parents d9e95bd + e76176e commit 63da8b0
Show file tree
Hide file tree
Showing 140 changed files with 1,537 additions and 727 deletions.
1 change: 1 addition & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ readxl
reasonwait
recid
refsource
renviron
rlang
rmarkdown
roxygen
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-changed-files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
pull_request:
branches: [main-R, master, main]
branches: [master, main, development]

name: lint-changed-files

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [master, main, main-R]
branches: [master, main, development]
pull_request:
branches: [master, main, main-R]
branches: [master, main, development]

name: test-coverage

Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ Imports:
slfhelper (>= 0.10.0),
stringdist (>= 0.9.10),
stringr (>= 1.5.0),
tarchetypes (>= 0.7.6),
targets (>= 1.2.0),
tibble (>= 3.2.1),
tidyr (>= 1.3.0),
tidyselect (>= 1.2.0),
Expand All @@ -61,8 +63,6 @@ Suggests:
covr (>= 3.6.1),
roxygen2 (>= 7.2.3),
spelling (>= 2.2),
tarchetypes (>= 0.7.5),
targets (>= 0.14.3),
testthat (>= 3.1.7)
Remotes:
Public-Health-Scotland/phsmethods,
Expand Down
16 changes: 3 additions & 13 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export(convert_hscp_to_hscpnames)
export(convert_numeric_to_date)
export(convert_sending_location_to_lca)
export(convert_year_to_fyyear)
export(create_episode_file)
export(create_individual_file)
export(create_service_use_cohorts)
export(end_fy)
Expand Down Expand Up @@ -41,6 +42,7 @@ export(get_homelessness_completeness_path)
export(get_it_deaths_path)
export(get_it_ltc_path)
export(get_it_prescribing_path)
export(get_la_code_opendata_lookup)
export(get_locality_path)
export(get_lookups_dir)
export(get_ltcs_path)
Expand Down Expand Up @@ -68,7 +70,6 @@ export(get_year_dir)
export(gzip_files)
export(is_date_in_fyyear)
export(is_missing)
export(la_code_lookup)
export(last_date_month)
export(latest_cost_year)
export(latest_update)
Expand Down Expand Up @@ -155,25 +156,14 @@ export(read_sc_all_alarms_telecare)
export(read_sc_all_care_home)
export(read_sc_all_home_care)
export(read_sc_all_sds)
export(run_episode_file)
export(setup_keyring)
export(start_fy)
export(start_fy_quarter)
export(start_next_fy_quarter)
export(write_file)
importFrom(data.table,.N)
importFrom(data.table,.SD)
importFrom(magrittr,"%>%")
importFrom(readr,col_character)
importFrom(readr,col_date)
importFrom(readr,col_datetime)
importFrom(readr,col_double)
importFrom(readr,col_factor)
importFrom(readr,col_integer)
importFrom(readr,col_logical)
importFrom(readr,col_number)
importFrom(readr,col_time)
importFrom(readr,cols)
importFrom(readr,cols_only)
importFrom(rlang,":=")
importFrom(rlang,.data)
importFrom(tibble,tibble)
13 changes: 8 additions & 5 deletions R/add_nsu_cohort.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@
#'
#' @param data The input data frame
#' @param year The year being processed
#' @param nsu_cohort The NSU data for the year
#'
#' @return A data frame containing the Non-Service Users as additional rows
#' @export
#'
#' @family episode_file
#' @seealso [get_nsu_path()]
add_nsu_cohort <- function(data, year) {
add_nsu_cohort <- function(
data,
year,
nsu_cohort = read_file(get_nsu_path(year))) {
year_param <- year

if (!check_year_valid(year, "NSU")) {
Expand All @@ -29,9 +33,9 @@ add_nsu_cohort <- function(data, year) {
)
)

matched <- dplyr::full_join(data,
# NSU cohort file
read_file(get_nsu_path(year)) %>%
matched <- dplyr::full_join(
data,
nsu_cohort %>%
dplyr::mutate(
dob = as.Date(.data[["dob"]]),
gpprac = convert_eng_gpprac_to_dummy(.data[["gpprac"]])
Expand Down Expand Up @@ -110,7 +114,6 @@ add_nsu_cohort <- function(data, year) {
.data[["chi"]]
)
) %>%
# Remove the additional columns
dplyr::select(-dplyr::contains("_nsu"), -"has_chi")

return(return_df)
Expand Down
2 changes: 1 addition & 1 deletion R/compute_mid_year_age.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
compute_mid_year_age <- function(fyyear, dob) {
age_intervals <- lubridate::interval(
start = dob,
end = as.Date(midpoint_fy(fyyear))
end = midpoint_fy(fyyear)
)

ages <- lubridate::as.period(age_intervals)$year
Expand Down
Loading

0 comments on commit 63da8b0

Please sign in to comment.