From 6340aca3201765c85a84d47f79e5319fc59c2c6d Mon Sep 17 00:00:00 2001 From: James McMahon Date: Fri, 11 Aug 2023 13:39:57 +0100 Subject: [PATCH 1/3] Rename `run_episode_file()` -> `create_episode_file()` This improves consistency! When speaking to Megan we noted that having the two 'main' functions with different names was needlessly confusing! --- NAMESPACE | 2 +- ...n_episode_file.R => create_episode_file.R} | 13 +++--- R/create_individual_file.R | 10 ++--- _targets.R | 2 +- man/add_acute_columns.Rd | 2 +- man/add_ae_columns.Rd | 2 +- man/add_all_columns.Rd | 2 +- man/add_at_columns.Rd | 2 +- man/add_ch_columns.Rd | 2 +- man/add_cij_columns.Rd | 2 +- man/add_cmh_columns.Rd | 2 +- man/add_dd_columns.Rd | 2 +- man/add_dn_columns.Rd | 2 +- man/add_gls_columns.Rd | 2 +- man/add_hc_columns.Rd | 2 +- man/add_hl1_columns.Rd | 2 +- man/add_ipdc_cols.Rd | 2 +- man/add_mat_columns.Rd | 2 +- man/add_mh_columns.Rd | 2 +- man/add_nrs_columns.Rd | 2 +- man/add_nsu_columns.Rd | 2 +- man/add_ooh_columns.Rd | 2 +- man/add_op_columns.Rd | 2 +- man/add_pis_columns.Rd | 2 +- man/add_sds_columns.Rd | 2 +- man/add_standard_cols.Rd | 2 +- man/aggregate_by_chi.Rd | 2 +- man/aggregate_ch_episodes.Rd | 2 +- man/clean_up_ch.Rd | 2 +- man/correct_cij_vars.Rd | 2 +- man/create_cohort_lookups.Rd | 2 +- man/create_cost_inc_dna.Rd | 2 +- ...episode_file.Rd => create_episode_file.Rd} | 16 +++---- man/create_individual_file.Rd | 10 ++--- man/fill_missing_cij_markers.Rd | 2 +- man/join_cohort_lookups.Rd | 2 +- man/load_ep_file_vars.Rd | 2 +- man/recode_gender.Rd | 2 +- man/remove_blank_chi.Rd | 2 +- man/store_ep_file_vars.Rd | 2 +- run_targets_tests.R | 42 +++++++++++++++++++ 41 files changed, 102 insertions(+), 61 deletions(-) rename R/{run_episode_file.R => create_episode_file.R} (97%) rename man/{run_episode_file.Rd => create_episode_file.Rd} (63%) create mode 100644 run_targets_tests.R diff --git a/NAMESPACE b/NAMESPACE index 6c4f3cd52..4e0266a5b 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -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) @@ -155,7 +156,6 @@ 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(start_fy) export(start_fy_quarter) export(start_next_fy_quarter) diff --git a/R/run_episode_file.R b/R/create_episode_file.R similarity index 97% rename from R/run_episode_file.R rename to R/create_episode_file.R index 19c2481f2..bad42be5e 100644 --- a/R/run_episode_file.R +++ b/R/create_episode_file.R @@ -1,16 +1,15 @@ -#' Produce the Source Episode file +#' Create the Source Episode file #' #' @param processed_data_list containing data from processed extracts. #' @param year The year to process, in FY format. #' @param write_to_disk (optional) Should the data be written to disk default is #' `TRUE` i.e. write the data to disk. #' @param anon_chi_out (Default:TRUE) Should `anon_chi` be used in the output -#' (instead of chi) +#' (instead of chi). #' -#' @return a [tibble][tibble::tibble-package] containing the episode file +#' @return the Source Episode file as a [tibble][tibble::tibble-package]. #' @export -#' -run_episode_file <- function( +create_episode_file <- function( processed_data_list, year, write_to_disk = TRUE, @@ -134,7 +133,7 @@ run_episode_file <- function( #' Store the unneeded episode file variables #' #' @param data The in-progress episode file data. -#' @inheritParams run_episode_file +#' @inheritParams create_episode_file #' @param vars_to_keep a character vector of the variables to keep, all others #' will be stored. #' @@ -172,7 +171,7 @@ store_ep_file_vars <- function(data, year, vars_to_keep) { #' Load the unneeded episode file variables #' -#' @inheritParams run_episode_file +#' @inheritParams create_episode_file #' @inheritParams store_ep_file_vars #' #' @return The full SLF data. diff --git a/R/create_individual_file.R b/R/create_individual_file.R index 84dbd28ee..c410bdd50 100644 --- a/R/create_individual_file.R +++ b/R/create_individual_file.R @@ -1,11 +1,11 @@ -#' Create individual file +#' Create the Source Individual file #' -#' @description Creates individual file from episode file +#' @description Creates the individual file from the episode file. #' -#' @param episode_file Tibble containing episodic data +#' @param episode_file Tibble containing episodic data. #' @param anon_chi_in (Default:TRUE) Is `anon_chi` used in the input -#' (instead of chi) -#' @inheritParams run_episode_file +#' (instead of chi). +#' @inheritParams create_episode_file #' #' @return The processed individual file #' @export diff --git a/_targets.R b/_targets.R index 9698cf27e..db26477ef 100644 --- a/_targets.R +++ b/_targets.R @@ -545,7 +545,7 @@ list( ), tar_target( episode_file, - run_episode_file( + create_episode_file( processed_data_list, year, write_to_disk diff --git a/man/add_acute_columns.Rd b/man/add_acute_columns.Rd index 52ba071b6..c2659f821 100644 --- a/man/add_acute_columns.Rd +++ b/man/add_acute_columns.Rd @@ -7,7 +7,7 @@ add_acute_columns(episode_file, prefix, condition) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} \item{prefix}{Prefix to add to related columns, e.g. "Acute"} diff --git a/man/add_ae_columns.Rd b/man/add_ae_columns.Rd index 9b7099513..fdc31b7ff 100644 --- a/man/add_ae_columns.Rd +++ b/man/add_ae_columns.Rd @@ -7,7 +7,7 @@ add_ae_columns(episode_file, prefix, condition) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} \item{prefix}{Prefix to add to related columns, e.g. "Acute"} diff --git a/man/add_all_columns.Rd b/man/add_all_columns.Rd index d502e95c3..1d2e587db 100644 --- a/man/add_all_columns.Rd +++ b/man/add_all_columns.Rd @@ -7,7 +7,7 @@ add_all_columns(episode_file) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} } \description{ Add new columns based on SMRType and recid which follow a pattern diff --git a/man/add_at_columns.Rd b/man/add_at_columns.Rd index e05ea9101..af978530a 100644 --- a/man/add_at_columns.Rd +++ b/man/add_at_columns.Rd @@ -7,7 +7,7 @@ add_at_columns(episode_file, prefix, condition) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} \item{prefix}{Prefix to add to related columns, e.g. "Acute"} diff --git a/man/add_ch_columns.Rd b/man/add_ch_columns.Rd index 4938f7690..a036a257e 100644 --- a/man/add_ch_columns.Rd +++ b/man/add_ch_columns.Rd @@ -7,7 +7,7 @@ add_ch_columns(episode_file, prefix, condition) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} \item{prefix}{Prefix to add to related columns, e.g. "Acute"} diff --git a/man/add_cij_columns.Rd b/man/add_cij_columns.Rd index 7d00e6299..c48c1a3ef 100644 --- a/man/add_cij_columns.Rd +++ b/man/add_cij_columns.Rd @@ -7,7 +7,7 @@ add_cij_columns(episode_file) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} } \description{ Add new columns related to CIJ diff --git a/man/add_cmh_columns.Rd b/man/add_cmh_columns.Rd index a1d82cba6..a1cb74abb 100644 --- a/man/add_cmh_columns.Rd +++ b/man/add_cmh_columns.Rd @@ -7,7 +7,7 @@ add_cmh_columns(episode_file, prefix, condition) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} \item{prefix}{Prefix to add to related columns, e.g. "Acute"} diff --git a/man/add_dd_columns.Rd b/man/add_dd_columns.Rd index 08d9c0fe4..11e85fdc7 100644 --- a/man/add_dd_columns.Rd +++ b/man/add_dd_columns.Rd @@ -7,7 +7,7 @@ add_dd_columns(episode_file, prefix, condition) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} \item{prefix}{Prefix to add to related columns, e.g. "Acute"} diff --git a/man/add_dn_columns.Rd b/man/add_dn_columns.Rd index bf6af008f..ffdf59a82 100644 --- a/man/add_dn_columns.Rd +++ b/man/add_dn_columns.Rd @@ -7,7 +7,7 @@ add_dn_columns(episode_file, prefix, condition) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} \item{prefix}{Prefix to add to related columns, e.g. "Acute"} diff --git a/man/add_gls_columns.Rd b/man/add_gls_columns.Rd index e71dc755b..6ab7e9645 100644 --- a/man/add_gls_columns.Rd +++ b/man/add_gls_columns.Rd @@ -7,7 +7,7 @@ add_gls_columns(episode_file, prefix, condition) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} \item{prefix}{Prefix to add to related columns, e.g. "Acute"} diff --git a/man/add_hc_columns.Rd b/man/add_hc_columns.Rd index 95d8f1d3b..a58f226ec 100644 --- a/man/add_hc_columns.Rd +++ b/man/add_hc_columns.Rd @@ -7,7 +7,7 @@ add_hc_columns(episode_file, prefix, condition) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} \item{prefix}{Prefix to add to related columns, e.g. "Acute"} diff --git a/man/add_hl1_columns.Rd b/man/add_hl1_columns.Rd index 7600db5e9..24fc714e9 100644 --- a/man/add_hl1_columns.Rd +++ b/man/add_hl1_columns.Rd @@ -7,7 +7,7 @@ add_hl1_columns(episode_file, prefix, condition) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} \item{prefix}{Prefix to add to related columns, e.g. "Acute"} diff --git a/man/add_ipdc_cols.Rd b/man/add_ipdc_cols.Rd index 0f91cbd90..bd630b9d3 100644 --- a/man/add_ipdc_cols.Rd +++ b/man/add_ipdc_cols.Rd @@ -7,7 +7,7 @@ add_ipdc_cols(episode_file, prefix, condition, ipdc_d = TRUE, elective = TRUE) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} \item{prefix}{Prefix to add to related columns, e.g. "Acute"} diff --git a/man/add_mat_columns.Rd b/man/add_mat_columns.Rd index aae729323..5faab0dc1 100644 --- a/man/add_mat_columns.Rd +++ b/man/add_mat_columns.Rd @@ -7,7 +7,7 @@ add_mat_columns(episode_file, prefix, condition) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} \item{prefix}{Prefix to add to related columns, e.g. "Acute"} diff --git a/man/add_mh_columns.Rd b/man/add_mh_columns.Rd index 3c50c6cb8..c587c490a 100644 --- a/man/add_mh_columns.Rd +++ b/man/add_mh_columns.Rd @@ -7,7 +7,7 @@ add_mh_columns(episode_file, prefix, condition) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} \item{prefix}{Prefix to add to related columns, e.g. "Acute"} diff --git a/man/add_nrs_columns.Rd b/man/add_nrs_columns.Rd index 9d7b3f8bf..b41201a57 100644 --- a/man/add_nrs_columns.Rd +++ b/man/add_nrs_columns.Rd @@ -7,7 +7,7 @@ add_nrs_columns(episode_file, prefix, condition) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} \item{prefix}{Prefix to add to related columns, e.g. "Acute"} diff --git a/man/add_nsu_columns.Rd b/man/add_nsu_columns.Rd index 6a54bbcbf..5aed481f0 100644 --- a/man/add_nsu_columns.Rd +++ b/man/add_nsu_columns.Rd @@ -7,7 +7,7 @@ add_nsu_columns(episode_file, prefix, condition) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} \item{prefix}{Prefix to add to related columns, e.g. "Acute"} diff --git a/man/add_ooh_columns.Rd b/man/add_ooh_columns.Rd index 01814ab6d..f1e6b63f5 100644 --- a/man/add_ooh_columns.Rd +++ b/man/add_ooh_columns.Rd @@ -7,7 +7,7 @@ add_ooh_columns(episode_file, prefix, condition) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} \item{prefix}{Prefix to add to related columns, e.g. "Acute"} diff --git a/man/add_op_columns.Rd b/man/add_op_columns.Rd index 08c4419e2..9fb8bc158 100644 --- a/man/add_op_columns.Rd +++ b/man/add_op_columns.Rd @@ -7,7 +7,7 @@ add_op_columns(episode_file, prefix, condition) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} \item{prefix}{Prefix to add to related columns, e.g. "Acute"} diff --git a/man/add_pis_columns.Rd b/man/add_pis_columns.Rd index b582acf2e..836218da0 100644 --- a/man/add_pis_columns.Rd +++ b/man/add_pis_columns.Rd @@ -7,7 +7,7 @@ add_pis_columns(episode_file, prefix, condition) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} \item{prefix}{Prefix to add to related columns, e.g. "Acute"} diff --git a/man/add_sds_columns.Rd b/man/add_sds_columns.Rd index d5a5fb2cf..c06b88527 100644 --- a/man/add_sds_columns.Rd +++ b/man/add_sds_columns.Rd @@ -7,7 +7,7 @@ add_sds_columns(episode_file, prefix, condition) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} \item{prefix}{Prefix to add to related columns, e.g. "Acute"} diff --git a/man/add_standard_cols.Rd b/man/add_standard_cols.Rd index 744aa49de..4392157d2 100644 --- a/man/add_standard_cols.Rd +++ b/man/add_standard_cols.Rd @@ -13,7 +13,7 @@ add_standard_cols( ) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} \item{prefix}{Prefix to add to related columns, e.g. "Acute"} diff --git a/man/aggregate_by_chi.Rd b/man/aggregate_by_chi.Rd index 013123902..1585accbb 100644 --- a/man/aggregate_by_chi.Rd +++ b/man/aggregate_by_chi.Rd @@ -7,7 +7,7 @@ aggregate_by_chi(episode_file) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} } \description{ Aggregate episode file by CHI to convert into diff --git a/man/aggregate_ch_episodes.Rd b/man/aggregate_ch_episodes.Rd index 1c955d666..3223e6d25 100644 --- a/man/aggregate_ch_episodes.Rd +++ b/man/aggregate_ch_episodes.Rd @@ -7,7 +7,7 @@ aggregate_ch_episodes(episode_file) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} } \description{ Aggregate CH variables by CHI and CIS. diff --git a/man/clean_up_ch.Rd b/man/clean_up_ch.Rd index 0182c84e8..c0c61966d 100644 --- a/man/clean_up_ch.Rd +++ b/man/clean_up_ch.Rd @@ -7,7 +7,7 @@ clean_up_ch(episode_file, year) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} \item{year}{The year to process, in FY format.} } diff --git a/man/correct_cij_vars.Rd b/man/correct_cij_vars.Rd index 97a7f046f..558514dc6 100644 --- a/man/correct_cij_vars.Rd +++ b/man/correct_cij_vars.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/run_episode_file.R +% Please edit documentation in R/create_episode_file.R \name{correct_cij_vars} \alias{correct_cij_vars} \title{Correct the CIJ variables} diff --git a/man/create_cohort_lookups.Rd b/man/create_cohort_lookups.Rd index f0ad267aa..109869074 100644 --- a/man/create_cohort_lookups.Rd +++ b/man/create_cohort_lookups.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/run_episode_file.R +% Please edit documentation in R/create_episode_file.R \name{create_cohort_lookups} \alias{create_cohort_lookups} \title{Create the cohort lookups} diff --git a/man/create_cost_inc_dna.Rd b/man/create_cost_inc_dna.Rd index 69e7e37b5..47c38b176 100644 --- a/man/create_cost_inc_dna.Rd +++ b/man/create_cost_inc_dna.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/run_episode_file.R +% Please edit documentation in R/create_episode_file.R \name{create_cost_inc_dna} \alias{create_cost_inc_dna} \title{Create cost total net inc DNA} diff --git a/man/run_episode_file.Rd b/man/create_episode_file.Rd similarity index 63% rename from man/run_episode_file.Rd rename to man/create_episode_file.Rd index 59d5fea1d..e1bda32b9 100644 --- a/man/run_episode_file.Rd +++ b/man/create_episode_file.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/run_episode_file.R -\name{run_episode_file} -\alias{run_episode_file} -\title{Produce the Source Episode file} +% Please edit documentation in R/create_episode_file.R +\name{create_episode_file} +\alias{create_episode_file} +\title{Create the Source Episode file} \usage{ -run_episode_file( +create_episode_file( processed_data_list, year, write_to_disk = TRUE, @@ -20,11 +20,11 @@ run_episode_file( \code{TRUE} i.e. write the data to disk.} \item{anon_chi_out}{(Default:TRUE) Should \code{anon_chi} be used in the output -(instead of chi)} +(instead of chi).} } \value{ -a \link[tibble:tibble-package]{tibble} containing the episode file +the Source Episode file as a \link[tibble:tibble-package]{tibble}. } \description{ -Produce the Source Episode file +Create the Source Episode file } diff --git a/man/create_individual_file.Rd b/man/create_individual_file.Rd index fa759e7b1..4fd9a4a53 100644 --- a/man/create_individual_file.Rd +++ b/man/create_individual_file.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/create_individual_file.R \name{create_individual_file} \alias{create_individual_file} -\title{Create individual file} +\title{Create the Source Individual file} \usage{ create_individual_file( episode_file, @@ -13,7 +13,7 @@ create_individual_file( ) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} \item{year}{The year to process, in FY format.} @@ -21,14 +21,14 @@ create_individual_file( \code{TRUE} i.e. write the data to disk.} \item{anon_chi_in}{(Default:TRUE) Is \code{anon_chi} used in the input -(instead of chi)} +(instead of chi).} \item{anon_chi_out}{(Default:TRUE) Should \code{anon_chi} be used in the output -(instead of chi)} +(instead of chi).} } \value{ The processed individual file } \description{ -Creates individual file from episode file +Creates the individual file from the episode file. } diff --git a/man/fill_missing_cij_markers.Rd b/man/fill_missing_cij_markers.Rd index 03b64217e..4795eed7a 100644 --- a/man/fill_missing_cij_markers.Rd +++ b/man/fill_missing_cij_markers.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/run_episode_file.R +% Please edit documentation in R/create_episode_file.R \name{fill_missing_cij_markers} \alias{fill_missing_cij_markers} \title{Fill any missing CIJ markers for records that should have them} diff --git a/man/join_cohort_lookups.Rd b/man/join_cohort_lookups.Rd index 445dcd7c0..15a860a36 100644 --- a/man/join_cohort_lookups.Rd +++ b/man/join_cohort_lookups.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/run_episode_file.R +% Please edit documentation in R/create_episode_file.R \name{join_cohort_lookups} \alias{join_cohort_lookups} \title{Join cohort lookups} diff --git a/man/load_ep_file_vars.Rd b/man/load_ep_file_vars.Rd index cee9cc440..509b0e00c 100644 --- a/man/load_ep_file_vars.Rd +++ b/man/load_ep_file_vars.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/run_episode_file.R +% Please edit documentation in R/create_episode_file.R \name{load_ep_file_vars} \alias{load_ep_file_vars} \title{Load the unneeded episode file variables} diff --git a/man/recode_gender.Rd b/man/recode_gender.Rd index 526d2829d..aaa28e6eb 100644 --- a/man/recode_gender.Rd +++ b/man/recode_gender.Rd @@ -7,7 +7,7 @@ recode_gender(episode_file) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} } \description{ Recode gender to 1.5 if 0 or 9. diff --git a/man/remove_blank_chi.Rd b/man/remove_blank_chi.Rd index 9cba40a8f..b290dd1e7 100644 --- a/man/remove_blank_chi.Rd +++ b/man/remove_blank_chi.Rd @@ -7,7 +7,7 @@ remove_blank_chi(episode_file) } \arguments{ -\item{episode_file}{Tibble containing episodic data} +\item{episode_file}{Tibble containing episodic data.} } \description{ Convert blank strings to NA and remove NAs from CHI column diff --git a/man/store_ep_file_vars.Rd b/man/store_ep_file_vars.Rd index 06316aac1..880266d58 100644 --- a/man/store_ep_file_vars.Rd +++ b/man/store_ep_file_vars.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/run_episode_file.R +% Please edit documentation in R/create_episode_file.R \name{store_ep_file_vars} \alias{store_ep_file_vars} \title{Store the unneeded episode file variables} diff --git a/run_targets_tests.R b/run_targets_tests.R new file mode 100644 index 000000000..8d6ad998b --- /dev/null +++ b/run_targets_tests.R @@ -0,0 +1,42 @@ +library(targets) +tar_make_future( + names = (targets::starts_with("tests_")) +) + +tar_make( + names = (targets::contains("1718")) +) +set.seed() + +sort(tar_outdated(reporter = "forecast")) +tar_make_future() +tar_visnetwork( + targets_only = TRUE, + level_separation = 750, + degree_from = 3, + degree_to = 3, + label = c("time", "size") +) +tar_meta() + +tar_prune() +tar_delete() +tar_invalidate() + + +reader <- arrow::ParquetFileReader$create(slf_path) +reader$GetSchema() + +years <- c("2223") +purrr::walk( + years, + function(year) { + code <- readr::read_lines("run_targets_1718.R") + + new_code <- stringr::str_replace(code, stringr::fixed("1718"), year) + + path <- stringr::str_glue("run_targets_{year}.R") + + readr::write_lines(new_code, path) + } +) From 7bd9a271ac09079165748d9f2f12257499162973 Mon Sep 17 00:00:00 2001 From: James McMahon Date: Mon, 14 Aug 2023 15:44:40 +0100 Subject: [PATCH 2/3] Delete run_targets_tests.R --- run_targets_tests.R | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 run_targets_tests.R diff --git a/run_targets_tests.R b/run_targets_tests.R deleted file mode 100644 index 8d6ad998b..000000000 --- a/run_targets_tests.R +++ /dev/null @@ -1,42 +0,0 @@ -library(targets) -tar_make_future( - names = (targets::starts_with("tests_")) -) - -tar_make( - names = (targets::contains("1718")) -) -set.seed() - -sort(tar_outdated(reporter = "forecast")) -tar_make_future() -tar_visnetwork( - targets_only = TRUE, - level_separation = 750, - degree_from = 3, - degree_to = 3, - label = c("time", "size") -) -tar_meta() - -tar_prune() -tar_delete() -tar_invalidate() - - -reader <- arrow::ParquetFileReader$create(slf_path) -reader$GetSchema() - -years <- c("2223") -purrr::walk( - years, - function(year) { - code <- readr::read_lines("run_targets_1718.R") - - new_code <- stringr::str_replace(code, stringr::fixed("1718"), year) - - path <- stringr::str_glue("run_targets_{year}.R") - - readr::write_lines(new_code, path) - } -) From ab420ac6d09c938558b9c666cae9de065256da15 Mon Sep 17 00:00:00 2001 From: Jennit07 Date: Mon, 25 Sep 2023 07:48:51 +0000 Subject: [PATCH 3/3] Update documentation --- man/read_file.Rd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/read_file.Rd b/man/read_file.Rd index b8231218f..1ef351342 100644 --- a/man/read_file.Rd +++ b/man/read_file.Rd @@ -14,7 +14,7 @@ read_file(path, col_select = NULL, as_data_frame = TRUE, ...) \link[tidyselect:eval_select]{tidy selection specification} of columns, as used in \code{dplyr::select()}.} -\item{as_data_frame}{Should the function return a \code{data.frame} (default) or +\item{as_data_frame}{Should the function return a \code{tibble} (default) or an Arrow \link[arrow]{Table}?} \item{...}{Addition arguments passed to the relevant function.}