Skip to content

Commit

Permalink
fix of youthvars fn ref and addition of documented fns@
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewphamilton committed Aug 5, 2021
1 parent 2a89715 commit 1d7a409
Show file tree
Hide file tree
Showing 113 changed files with 343 additions and 221 deletions.
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ export(transform_uid_var)
export(validate_TTU_predictors_lup)
export(write_analyses)
export(write_box_cox_tfmn)
export(write_csp_output)
export(write_main_oupt_dir)
export(write_manuscript)
export(write_mdl_cmprsn)
Expand All @@ -185,6 +186,7 @@ export(write_predr_and_covars_cmprsn)
export(write_predr_and_mdl_tstng_results)
export(write_predr_cmprsn_outps)
export(write_report)
export(write_reporting_dir)
export(write_rprt_with_rcrd)
export(write_scndry_analysis)
export(write_scndry_analysis_dir)
Expand Down Expand Up @@ -277,6 +279,7 @@ importFrom(kableExtra,kbl)
importFrom(knitr,knit_child)
importFrom(knitr,knit_expand)
importFrom(knitr,opts_current)
importFrom(knitr,purl)
importFrom(lubridate,days)
importFrom(magrittr,"%>%")
importFrom(pacman,p_load)
Expand Down
21 changes: 0 additions & 21 deletions R/fn_get.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#' @rdname get_background_text
#' @export

#' @keywords internal
get_background_text <- function (results_ls)
{
text_1L_chr <- results_ls$study_descs_ls$background_1L_chr
Expand Down Expand Up @@ -34,7 +33,6 @@ get_cndts_for_mxd_mdls <- function (mdl_types_lup = NULL)
#' @rdname get_conclusion_text
#' @export

#' @keywords internal
get_conclusion_text <- function (results_ls)
{
text_1L_chr <- results_ls$study_descs_ls$conclusion_1L_chr
Expand All @@ -48,7 +46,6 @@ get_conclusion_text <- function (results_ls)
#' @rdname get_covar_ctgs
#' @export
#' @importFrom stringi stri_replace_last_fixed
#' @keywords internal
get_covar_ctgs <- function (results_ls, collapse_1L_lgl = T)
{
covar_ctgs_chr <- names(results_ls$candidate_covars_ls) %>%
Expand All @@ -70,7 +67,6 @@ get_covar_ctgs <- function (results_ls, collapse_1L_lgl = T)
#' @importFrom stats setNames
#' @importFrom stringi stri_replace_last_fixed
#' @importFrom Hmisc capitalize
#' @keywords internal
get_covars_by_ctg <- function (results_ls, collapse_1L_lgl = F)
{
covars_by_ctg_ls <- results_ls$candidate_covars_ls %>% purrr::map(~.x %>%
Expand All @@ -96,7 +92,6 @@ get_covars_by_ctg <- function (results_ls, collapse_1L_lgl = F)
#' @rdname get_hlth_utl_nm
#' @export

#' @keywords internal
get_hlth_utl_nm <- function (results_ls, short_nm_1L_lgl = T)
{
health_utl_nm_1L_chr <- ifelse(short_nm_1L_lgl, results_ls$study_descs_ls$health_utl_nm_1L_chr,
Expand All @@ -111,7 +106,6 @@ get_hlth_utl_nm <- function (results_ls, short_nm_1L_lgl = T)
#' @rdname get_hlth_utl_stat
#' @export

#' @keywords internal
get_hlth_utl_stat <- function (results_ls, stat_1L_chr = "bl_mean")
{
hlth_utl_stat_1L_chr <- switch(stat_1L_chr, bl_mean = results_ls$hlth_utl_and_predrs_ls$bl_hu_mean_1L_dbl,
Expand All @@ -128,7 +122,6 @@ get_hlth_utl_stat <- function (results_ls, stat_1L_chr = "bl_mean")
#' @rdname get_link_from_tfmn
#' @export

#' @keywords internal
get_link_from_tfmn <- function (tfmn_1L_chr, is_OLS_1L_lgl = F)
{
link_1L_chr <- ifelse(is_OLS_1L_lgl, "identity", ifelse(tfmn_1L_chr ==
Expand All @@ -147,7 +140,6 @@ get_link_from_tfmn <- function (tfmn_1L_chr, is_OLS_1L_lgl = F)
#' @rdname get_lngl_ttu_types
#' @export
#' @importFrom stringi stri_replace_last
#' @keywords internal
get_lngl_ttu_types <- function (results_ls, collapse_1L_lgl = T)
{
mdl_types_chr <- results_ls$ttu_lngl_ls$best_mdls_tb$model_type
Expand All @@ -169,7 +161,6 @@ get_lngl_ttu_types <- function (results_ls, collapse_1L_lgl = T)
#' @importFrom purrr map map_chr
#' @importFrom stats setNames
#' @importFrom stringi stri_replace_last_fixed
#' @keywords internal
get_mdl_cmprsns <- function (results_ls, describe_1L_lgl = T, mixed_1L_lgl = F,
as_list_1L_lgl = F)
{
Expand Down Expand Up @@ -227,7 +218,6 @@ get_mdl_cmprsns <- function (results_ls, describe_1L_lgl = T, mixed_1L_lgl = F,
#' @importFrom utils data
#' @importFrom dplyr pull
#' @importFrom purrr map_lgl
#' @keywords internal
get_mdl_type_from_nm <- function (mdl_nm_1L_chr, mdl_types_lup = NULL)
{
if (is.null(mdl_types_lup))
Expand All @@ -247,7 +237,6 @@ get_mdl_type_from_nm <- function (mdl_nm_1L_chr, mdl_types_lup = NULL)
#' @importFrom purrr map flatten map_lgl
#' @importFrom dplyr filter pull
#' @importFrom stats setNames
#' @keywords internal
get_mdls_with_signft_covars <- function (outp_smry_ls, params_ls_ls)
{
signft_covars_chr <- outp_smry_ls$mdls_with_covars_smry_tb %>%
Expand All @@ -272,7 +261,6 @@ get_mdls_with_signft_covars <- function (outp_smry_ls, params_ls_ls)
#' @export
#' @importFrom purrr map_int
#' @importFrom xfun numbers_to_words
#' @keywords internal
get_nbr_of_predrs <- function (results_ls, as_words_1L_lgl = T)
{
nbr_of_predrs_xx <- results_ls$study_descs_ls$predr_ctgs_ls %>%
Expand All @@ -291,7 +279,6 @@ get_nbr_of_predrs <- function (results_ls, as_words_1L_lgl = T)
#' @importFrom purrr map_lgl map2_chr
#' @importFrom xfun numbers_to_words
#' @importFrom stringi stri_replace_last_fixed
#' @keywords internal
get_nbr_of_predrs_by_ctg <- function (results_ls)
{
multiple_1L_lgl <- length(get_predr_ctgs(results_ls, collapse_1L_lgl = F) >
Expand All @@ -317,7 +304,6 @@ get_nbr_of_predrs_by_ctg <- function (results_ls)
#' @export
#' @importFrom xfun numbers_to_words
#' @importFrom Hmisc capitalize
#' @keywords internal
get_nbr_of_scndry_analyses <- function (results_ls, as_words_1L_lgl = T, capitalise_1L_lgl = T)
{
nbr_of_scndry_analyses_1L_xx <- names(results_ls$mdl_ingredients_ls) %>%
Expand All @@ -341,7 +327,6 @@ get_nbr_of_scndry_analyses <- function (results_ls, as_words_1L_lgl = T, capital
#' @rdname get_ordered_sngl_csnl_mdls
#' @export
#' @importFrom stringi stri_replace_last
#' @keywords internal
get_ordered_sngl_csnl_mdls <- function (results_ls, select_int = NULL, collapse_1L_lgl = F)
{
ordered_sngl_csnl_mdls_chr <- results_ls$ttu_cs_ls$cs_mdls_predrs_seq_dscdng_chr
Expand All @@ -362,7 +347,6 @@ get_ordered_sngl_csnl_mdls <- function (results_ls, select_int = NULL, collapse_
#' @rdname get_popl_descvs
#' @export
#' @importFrom stringi stri_replace_last_fixed
#' @keywords internal
get_popl_descvs <- function (results_ls)
{
popl_descvs_1L_chr <- results_ls$tables_ls$participant_descs$variable %>%
Expand All @@ -379,7 +363,6 @@ get_popl_descvs <- function (results_ls)
#' @export
#' @importFrom purrr map_int
#' @importFrom stringi stri_replace_last_fixed
#' @keywords internal
get_predr_ctgs <- function (results_ls, collapse_1L_lgl = T)
{
predr_ctgs_chr <- (results_ls$study_descs_ls$predr_ctgs_ls %>%
Expand All @@ -406,7 +389,6 @@ get_predr_ctgs <- function (results_ls, collapse_1L_lgl = T)
#' @importFrom Hmisc capitalize
#' @importFrom ready4fun get_from_lup_obj
#' @importFrom stringi stri_replace_last_fixed stri_replace_last
#' @keywords internal
get_predrs_by_ctg <- function (results_ls, long_desc_1L_lgl = F, transform_1L_lgl = F,
collapse_1L_lgl = F)
{
Expand Down Expand Up @@ -453,7 +435,6 @@ get_predrs_by_ctg <- function (results_ls, long_desc_1L_lgl = F, transform_1L_lg
#' @rdname get_prefd_mdl_predrs
#' @export
#' @importFrom stringi stri_replace_last
#' @keywords internal
get_prefd_mdl_predrs <- function (results_ls)
{
predrs_1L_chr <- results_ls$predr_var_nms_chr %>% paste0(collapse = ", ") %>%
Expand Down Expand Up @@ -492,7 +473,6 @@ get_random_intercept <- function (mdls_smry_tb, mdl_nm_1L_chr, deterministic_1L_
#' @importFrom ready4fun get_from_lup_obj
#' @importFrom ready4use remove_labels_from_ds
#' @importFrom stringi stri_replace_last_fixed
#' @keywords internal
get_scndry_anlys_descs <- function (results_ls)
{
nbr_of_scndry_analyses_1L_int <- get_nbr_of_scndry_analyses(results_ls,
Expand Down Expand Up @@ -529,7 +509,6 @@ get_scndry_anlys_descs <- function (results_ls)
#' @export
#' @importFrom purrr pmap_chr
#' @importFrom stringi stri_replace_last
#' @keywords internal
get_selected_mixed_mdls <- function (results_ls, collapse_1L_lgl = T)
{
mixed_mdls_xx <- results_ls$ttu_lngl_ls$best_mdls_tb %>%
Expand Down
Loading

0 comments on commit 1d7a409

Please sign in to comment.