From 51a7625f0612d58429ac654227644ecacc3ac552 Mon Sep 17 00:00:00 2001 From: Joe Zhu Date: Wed, 27 Nov 2024 23:37:37 +0800 Subject: [PATCH] 11 cran (#13) Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- .Rbuildignore | 7 +++++++ DESCRIPTION | 16 ++++++++++++---- NEWS.md | 5 ++++- R/autoslideR_error.R | 1 + R/decorate.R | 16 +++++++++++----- R/fastdocall.R | 1 + R/ft_formats.R | 2 +- R/generate_output.R | 2 ++ R/helper_functions.R | 6 +++--- R/null_report.R | 2 +- R/save_output.R | 6 +++++- R/spec.R | 4 ---- R/t_ae_pt_slide.R | 2 +- R/t_ae_pt_soc_slide.R | 2 +- R/t_dor_slide.R | 2 +- R/to_slides.R | 7 ++++--- R/util.R | 26 ++++++++++++++++---------- inst/WORDLIST | 4 ++++ man/autoslider.core-package.Rd | 3 ++- man/autoslider_error.Rd | 3 +++ man/autoslider_format.Rd | 3 +++ man/build_table_header.Rd | 3 +++ man/check_and_set_cutoff.Rd | 3 +++ man/dec_paste.Rd | 3 +++ man/decorate-VTableTree-method.Rd | 3 +++ man/decorate-listing_df-method.Rd | 3 +++ man/decorate.Rd | 3 +++ man/decorate.autoslider_error.Rd | 3 +++ man/decorate.default.Rd | 3 +++ man/decorate.ggplot.Rd | 3 +++ man/decorate.grob.Rd | 3 +++ man/decorate.list.Rd | 3 +++ man/decorate_outputs.Rd | 3 +++ man/fastDoCall.Rd | 3 +++ man/filter_spec.Rd | 4 ---- man/format_3d.Rd | 3 +++ man/generate_output.Rd | 3 +++ man/generate_outputs.Rd | 3 +++ man/generate_slides.Rd | 5 ++++- man/lyt_to_side_by_side.Rd | 3 +++ man/lyt_to_side_by_side_two_data.Rd | 3 +++ man/mutate_actarm.Rd | 3 +++ man/na_replace.Rd | 3 +++ man/new_round.Rd | 3 +++ man/null_report.Rd | 3 +++ man/perc_perc.Rd | 3 +++ man/ph_with_img.Rd | 3 +++ man/preprocess_t_dd.Rd | 3 +++ man/preprocess_t_ds.Rd | 3 +++ man/print.decoratedGrob.Rd | 3 +++ man/print.decoratedGrobSet.Rd | 3 +++ man/s_proportion_1.Rd | 4 ++++ man/s_surv_time_1.Rd | 4 ++++ man/save_output.Rd | 8 ++++++++ man/save_outputs.Rd | 3 +++ man/slides_preview.Rd | 3 +++ man/t_ae_pt_slide.Rd | 2 +- man/t_ae_pt_soc_slide.Rd | 2 +- man/t_dor_slide.Rd | 3 +++ man/to_vector.Rd | 3 +++ man/trim_perc.Rd | 3 +++ man/trim_perc1.Rd | 3 +++ 62 files changed, 207 insertions(+), 44 deletions(-) mode change 100644 => 100755 DESCRIPTION mode change 100644 => 100755 NEWS.md diff --git a/.Rbuildignore b/.Rbuildignore index 57980ea2..823ce0af 100755 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -20,6 +20,13 @@ R/util_experimental.R ^_pkgdown\.yml$ ^docs$ ^pkgdown$ +LICENSE # dev tmp/ +ae.pptx +ae_summary.pptx +dd.pptx +dm.pptx +dor.pptx + ‘output.pptx’ diff --git a/DESCRIPTION b/DESCRIPTION old mode 100644 new mode 100755 index 84732e01..8ea07364 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: autoslider.core -Title: Slides automation with R -Version: 0.0.1.9033 +Title: Slide Automation for Tables, Listings and Figures +Version: 0.1.0 Authors@R: c( person("Joe", "Zhu", , "joe.zhu@roche.com", role = c("cre", "aut")), person("Heng", "Wang", role = "aut"), @@ -20,9 +20,17 @@ Authors@R: c( person("Elisabeth", "Deutschmann", role = "ctb"), person("Chenkai", "Lv", role = "aut") ) -Description: Slides automation with R. -License: file LICENSE +Description: The normal process of creating clinical study slides is that a statistician + manually type in the numbers from outputs and a separate statistician to double check + the typed in numbers. This process is time consuming, resource intensive, and error + prone. Automatic slide generation is a solution to address these issues. It reduces the + amount of work and the required time when creating slides, and reduces the risk of + errors from manually typing or copying numbers from the output to slides. It also + helps users to avoid unnecessary stress when creating large amounts of slide decks + in a short time window. +License: Apache License 2.0 URL: https://github.com/insightsengineering/autoslider.core +BugReports: https://github.com/insightsengineering/autoslider.core/issues Depends: flextable (>= 0.9.4), officer (>= 0.3.18), diff --git a/NEWS.md b/NEWS.md old mode 100644 new mode 100755 index 910159f6..ffa6fe6d --- a/NEWS.md +++ b/NEWS.md @@ -1 +1,4 @@ -# autoslider.core 0.0.1.9033 +# autoslider.core 0.1.0 + +### Miscellaneous + * First release. diff --git a/R/autoslideR_error.R b/R/autoslideR_error.R index 0cea0df7..f0614c7b 100755 --- a/R/autoslideR_error.R +++ b/R/autoslideR_error.R @@ -7,6 +7,7 @@ #' @param x character scaler #' @param spec spec should be a list containing "program" and "suffix" #' @param step step is a character indicating in which step the pipeline encounter error +#' @return autoslider_error object #' @export autoslider_error <- function(x, spec, step) { assert_is_character_scalar(x) diff --git a/R/decorate.R b/R/decorate.R index 03fa2a46..b19a5e5a 100755 --- a/R/decorate.R +++ b/R/decorate.R @@ -1,4 +1,5 @@ #' generic function decorate +#' @return No return value, called for side effects #' @export setGeneric("decorate", function(x, ...) standardGeneric("decorate")) @@ -12,7 +13,7 @@ decorate <- function(x, ...) { #' default method to decorate #' @param x object to decorate #' @param ... additional arguments. not used. -#' +#' @return No return value, called for side effects #' @export decorate.default <- function(x, ...) { stop("default decorate function does not exist") @@ -21,7 +22,7 @@ decorate.default <- function(x, ...) { #' decorate method for autoslider_error class #' @param x object to decorate #' @param ... additional arguments. not used. -#' +#' @return No return value, called for side effects #' @export decorate.autoslider_error <- function(x, ...) { x @@ -35,6 +36,7 @@ decorate.autoslider_error <- function(x, ...) { #' @param paper Orientation and font size as string, e.g. "P8"; "L11" #' @param for_test `logic` CICD parameter #' @param ... Additional arguments passed to the decoration function. +#' @return No return value, called for side effects setMethod( "decorate", "VTableTree", decorate.VTableTree <- function(x, titles = "", footnotes = "", paper = "P8", for_test = FALSE, ...) { @@ -74,6 +76,7 @@ setMethod( #' @param paper Paper size, by default "L11" #' @param for_test `logic` CICD parameter #' @param ... additional arguments. not used. +#' @return No return value, called for side effects #' @details #' The paper default paper size, `L11`, indicate that the fontsize is 11. #' The fontsize of the footnotes, is the fontsize of the titles minus 2. @@ -97,6 +100,7 @@ decorate.ggplot <- function(x, titles = "", footnotes = "", paper = "L11", for_t #' @param paper Orientation and font size as string, e.g. "P8"; "L11" #' @param for_test `logic` CICD parameter #' @param ... Additional arguments. not used. +#' @return No return value, called for side effects setMethod( "decorate", "listing_df", decorate.listing_df <- function(x, titles = "", footnotes = "", paper = "P8", for_test = FALSE, ...) { @@ -134,6 +138,7 @@ setMethod( #' @param paper paper size. default is "L8". #' @param for_test `logic` CICD parameter #' @param ... Additional arguments. not used. +#' @return No return value, called for side effects #' @details #' The paper default paper size, `L11`, indicate that the fontsize is 11. #' The fontsize of the footnotes, is the fontsize of the titles minus 2. @@ -165,6 +170,7 @@ decorate.grob <- #' @details #' The paper default paper size, `L11`, indicate that the fontsize is 11. #' The fontsize of the footnotes, is the fontsize of the titles minus 2. +#' @return No return value, called for side effects #' @export #' decorate.list <- @@ -204,7 +210,7 @@ decorate.list <- #' @param generic_footnote `character` vector of footnotes #' @param version_label `character`. A version label to be added to the title. #' @param for_test `logic` CICD parameter -#' +#' @return No return value, called for side effects #' @details #' `generic_title` and `generic_footnote` will be added to *all* outputs. The use #' case is to add information such as protocol number and snapshot date defined @@ -284,7 +290,7 @@ decorate_outputs <- function(outputs, #' #' @param x An object of class `decoratedGrob` #' @param ... not used. -#' +#' @return No return value, called for side effects #' @export print.decoratedGrob <- function(x, ...) { grid::grid.newpage() @@ -295,7 +301,7 @@ print.decoratedGrob <- function(x, ...) { #' #' @param x An object of class `decoratedGrobSet` #' @param ... not used. -#' +#' @return No return value, called for side effects #' @export print.decoratedGrobSet <- function(x, ...) { for (plot in x) { diff --git a/R/fastdocall.R b/R/fastdocall.R index 57a07fc2..e19e235f 100755 --- a/R/fastdocall.R +++ b/R/fastdocall.R @@ -5,6 +5,7 @@ #' @param quote a logical value indicating whether to quote the arguments. #' @param envir an environment within which to evaluate the call. This will be most useful if what is a character #' string and the arguments are symbols or quoted expressions. +#' @return No return value, called for side effects #' @export fastDoCall <- function(what, diff --git a/R/ft_formats.R b/R/ft_formats.R index 0743b477..f07a40d8 100755 --- a/R/ft_formats.R +++ b/R/ft_formats.R @@ -17,7 +17,7 @@ NULL #' @param font_name Font name, default to arial #' @param body_font_size Font size of the table content, default to 12 #' @param header_font_size Font size of the table header, default to 14 -#' +#' @return A flextable with applied theme. #' @export autoslider_format <- function(ft, odd_header = "#0EAED5", # "deepskyblue2", diff --git a/R/generate_output.R b/R/generate_output.R index 1c96d5e6..36be0ce0 100755 --- a/R/generate_output.R +++ b/R/generate_output.R @@ -4,6 +4,7 @@ #' @param datasets list of datasets #' @param spec spec #' @param verbose_level Verbose level of messages be displayed. See details for further information. +#' @return No return value, called for side effects #' @details #' `verbose_level` is used to control how many messages are printed out. #' By default, `2` will show all filter messages and show output generation message. @@ -89,6 +90,7 @@ generate_output <- #' @param spec Specification list generated by `read_spec` #' @param datasets A `list` of datasets #' @param verbose_level Verbose level of messages be displayed. See details for further information. +#' @return No return value, called for side effects #' @details #' `verbose_level` is used to control how many messages are printed out. #' By default, `2` will show all filter messages and show output generation message. diff --git a/R/helper_functions.R b/R/helper_functions.R index 5917c63a..3939ba3a 100755 --- a/R/helper_functions.R +++ b/R/helper_functions.R @@ -4,7 +4,7 @@ #' @param arm_var Arm variable #' @param levels factor levels #' @param labels factor labels -#' +#' @return Dataframe with re-level and re-labelled arm variable. #' @export mutate_actarm <- function(df, arm_var = "TRT01A", @@ -25,7 +25,7 @@ mutate_actarm <- function(df, #' @param df Input dataframe #' @param levels factor levels #' @param labels factor labels -#' +#' @return dataframe #' @export preprocess_t_dd <- function(df, levels = c("PROGRESSIVE DISEASE", "ADVERSE EVENT", "OTHER", ""), @@ -55,7 +55,7 @@ preprocess_t_dd <- function(df, #' @param df Input dataframe #' @param levels factor levels #' @param labels factor labels -#' +#' @return dataframe #' @export preprocess_t_ds <- function(df, levels = c("Alive: On Treatment", "Alive: In Follow-up", ""), diff --git a/R/null_report.R b/R/null_report.R index 2038dbc4..fba18a26 100755 --- a/R/null_report.R +++ b/R/null_report.R @@ -5,7 +5,7 @@ #' @details #' This will create a null report similar as STREAM does. You can use #' it inside output functions as shown in the example below. -#' +#' @return An empty `rtables` object #' @examples #' library(dplyr) #' library(filters) diff --git a/R/save_output.R b/R/save_output.R index 83f5e1be..9eddb79d 100755 --- a/R/save_output.R +++ b/R/save_output.R @@ -35,6 +35,7 @@ save_output <- function(output, file_name, save_rds = TRUE) { } #' @rdname save_output +#' @return No return value, called for side effects #' @export save_output.autoslider_error <- function(output, file_name, @@ -53,6 +54,7 @@ setMethod("save_output", "dVTableTree", save_output.dVTableTree <- function(outp }) #' @rdname save_output +#' @return The input `object` invisibly #' @export save_output.decoratedGrob <- function(output, file_name, @@ -65,6 +67,7 @@ save_output.decoratedGrob <- function(output, } #' @rdname save_output +#' @return The input `object` invisibly #' @export save_output.decoratedGrobSet <- function(output, file_name, save_rds = TRUE) { if (save_rds) { @@ -76,6 +79,7 @@ save_output.decoratedGrobSet <- function(output, file_name, save_rds = TRUE) { #' @rdname save_output +#' @return The input `object` invisibly #' @export save_output.dlisting <- function(output, file_name, save_rds = TRUE) { if (save_rds) { @@ -96,7 +100,7 @@ save_output.dlisting <- function(output, file_name, save_rds = TRUE) { #' in addition to `.out` or `.pdf` files? Defaults to `FALSE`. #' @param generic_suffix generic suffix. must be length 1 character or NULL. #' @export -#' +#' @return The input `object` invisibly #' @examples #' ## As `save_outputs` is the last step in the pipeline we have to run #' ## the 'whole machinery' in order to show its functionality. Also take a look diff --git a/R/spec.R b/R/spec.R index aa482578..0092d527 100755 --- a/R/spec.R +++ b/R/spec.R @@ -74,10 +74,6 @@ validate_spec <- function(spec) { #' library(dplyr) #' spec_file <- system.file("spec.yml", package = "autoslider.core") #' spec <- spec_file %>% read_spec() -#' ## Keep only outputs belonging to batch 2 -#' \dontrun{ -#' filter_spec(spec, batch == 2) -#' } #' #' ## Keep only the t_dm_IT output #' filter_spec(spec, output == "t_dm_IT") diff --git a/R/t_ae_pt_slide.R b/R/t_ae_pt_slide.R index 3dfce3eb..eb0cee32 100644 --- a/R/t_ae_pt_slide.R +++ b/R/t_ae_pt_slide.R @@ -23,7 +23,7 @@ #' ) #' out <- t_ae_pt_slide(adsl, adae, "TRT01A", 2) #' print(out) -#' generate_slides(out, "ae.pptx") +#' generate_slides(out, paste0(tempdir(), "/ae.pptx")) #' #' # Example 2, prune by total column #' out2 <- t_ae_pt_slide(adsl, adae, "TRT01A", 25, prune_by_total = TRUE) diff --git a/R/t_ae_pt_soc_slide.R b/R/t_ae_pt_soc_slide.R index a8d726f0..baa4f3f1 100644 --- a/R/t_ae_pt_soc_slide.R +++ b/R/t_ae_pt_soc_slide.R @@ -22,7 +22,7 @@ #' ) #' out <- t_ae_pt_soc_slide(adsl, adae, "TRT01A", 2) #' print(out) -#' generate_slides(out, "ae.pptx") +#' generate_slides(out, paste0(tempdir(), "/ae.pptx")) #' #' #' # Example 2, prune by total column diff --git a/R/t_dor_slide.R b/R/t_dor_slide.R index 819bc226..1187d900 100755 --- a/R/t_dor_slide.R +++ b/R/t_dor_slide.R @@ -4,7 +4,7 @@ #' @param arm Arm variable, character, "`TRT01P" by default. #' @param refgroup Reference group #' @inherit gen_notes note -#' +#' @return An `rtables` object #' @export #' @examples #' library(dplyr) diff --git a/R/to_slides.R b/R/to_slides.R index 39f61641..c19d65f3 100755 --- a/R/to_slides.R +++ b/R/to_slides.R @@ -14,6 +14,7 @@ #' @param l_cpp An integer specifying the listing columns per page\cr #' Specify this optional argument to modify the width of all of the listings display #' @param ... arguments passed to program +#' @return No return value, called for side effects #' @export #' @examples #' @@ -44,7 +45,7 @@ #' t_dm_slide(adsl, "TRT01P", c("SEX", "AGE")) %>% #' generate_slides() generate_slides <- function(outputs, - outfile = "output.pptx", + outfile = paste0(tempdir(), "/output.pptx"), template = file.path(system.file(package = "autoslider.core"), "theme/basic.pptx"), fig_width = 9, fig_height = 6, t_lpp = 20, t_cpp = 200, l_lpp = 20, l_cpp = 150, ...) { if (any(c( @@ -117,6 +118,7 @@ generate_slides <- function(outputs, #' Generate flextable for preview first page #' #' @param x rtables or data.frame +#' @return A flextable or a ggplot object depending to the input. #' @export #' @examples #' # Example 1. preview table @@ -149,7 +151,6 @@ get_body_bottom_location <- function(ppt) { #' @param ft Flextable object #' @param ppt_width Powerpoint width #' @param ppt_height Powerpoint height -#' #' @return Location for a placeholder center_table_loc <- function(ft, ppt_width, ppt_height) { top <- 0.17 * ppt_height @@ -259,7 +260,7 @@ center_figure_loc <- function(fig_width, fig_height, ppt_width, ppt_height) { #' @param fig_width width of figure #' @param fig_height height of figure #' @param figure_loc location of figure -#' +#' @return Location for a placeholder #' @export ph_with_img <- function(ppt, figure, fig_width, fig_height, figure_loc) { file_name <- tempfile(fileext = ".svg") diff --git a/R/util.R b/R/util.R index fc2002d0..3ec25ee2 100755 --- a/R/util.R +++ b/R/util.R @@ -6,7 +6,7 @@ format_xx <- function(str) { #' #' @param data dataframe #' @param cutoff cutoff threshold -#' +#' @return Set the cutoff value #' @export check_and_set_cutoff <- function(data, cutoff) { if (is.na(cutoff)) { @@ -25,7 +25,7 @@ check_and_set_cutoff <- function(data, cutoff) { #' Replace NAs to NA #' #' @param table_df Table dataframe -#' +#' @return Input dataframe with both column replaced to NA #' @export na_replace <- function(table_df) { if (length(colnames(table_df)) == 2) { @@ -43,7 +43,7 @@ na_replace <- function(table_df) { #' Concatenate arguments into a string #' #' @param ... arguments passed to program -#' +#' @return No return value, called for side effects #' @export dec_paste <- function(...) { arguments <- list( @@ -60,7 +60,7 @@ dec_paste <- function(...) { #' Convert list of numbers to vectors #' #' @param num_list list of numbers -#' +#' @return No return value, called for side effects #' @export to_vector <- function(num_list) { sapply(num_list, function(x) { @@ -75,6 +75,7 @@ to_vector <- function(num_list) { #' Founding method #' @param x number need to be rounded #' @param digits number of digits +#' @return rounded value #' @export new_round <- function(x, digits = 1) { posneg <- sign(x) @@ -89,7 +90,7 @@ new_round <- function(x, digits = 1) { #' #' @param x input array #' @param output output handle -#' +#' @return formatted values #' @export trim_perc1 <- function(x, output) { paste0(x[1], " (", new_round(x[2] * 100, 1), ")") @@ -99,7 +100,7 @@ trim_perc1 <- function(x, output) { #' #' @param x input array #' @param output output handle -#' +#' @return formatted values #' @export trim_perc <- function(x, output) { paste0(x[1], " (", new_round(x[2] * 100, 2), ")") @@ -109,7 +110,7 @@ trim_perc <- function(x, output) { #' #' @param x input array #' @param output output handle -#' +#' @return formatted values #' @export perc_perc <- function(x, output) { paste0(round(x[1] * 100, 1), "% (", round(x[2] * 100, 1), "%)") @@ -119,7 +120,7 @@ perc_perc <- function(x, output) { #' #' @param x input array #' @param output output handle -#' +#' @return formatted values #' @export format_3d <- function(x, output) { paste0(round(x[1], 2), " (", round(x[2], 2), ", ", round(x[3], 2), ")") @@ -132,7 +133,8 @@ format_3d <- function(x, output) { #' @param .var variable of interest #' @param is_event vector indicating event #' @param control `control_surv_time()` by default -#' +#' @return A function suitable for use in rtables::analyze() with element selection, +#' reformatting, and relabeling performed automatically. #' @export s_surv_time_1 <- function(df, .var, is_event, control = control_surv_time()) { # assert_that(is_df_with_variables(df, list(tte = .var, is_event = is_event)), @@ -171,7 +173,8 @@ s_surv_time_1 <- function(df, .var, is_event, control = control_surv_time()) { #' @param conf_level confidence level #' @param method type of method for calculation #' @param long flag -#' +#' @return A function suitable for use in rtables::analyze() with element selection, +#' reformatting, and relabeling performed automatically. #' @export s_proportion_1 <- function(x, conf_level = 0.95, method = c( @@ -516,6 +519,7 @@ warn_about_legacy_paper_size <- function(old_paper_size, #' @param lyt layout object #' @param anl analysis data object #' @param side_by_side A logical value indicating whether to display the data side by side. +#' @return An `rtables` layout #' @export lyt_to_side_by_side <- function(lyt, anl, side_by_side = NULL) { result <- build_table(lyt = lyt, df = anl) @@ -543,6 +547,7 @@ lyt_to_side_by_side <- function(lyt, anl, side_by_side = NULL) { #' @param anl analysis data object #' @param side_by_side A logical value indicating whether to display the data side by side. #' @param alt_counts_df alternative data frame for counts +#' @return An `rtables` layout #' @export lyt_to_side_by_side_two_data <- function(lyt, anl, alt_counts_df, side_by_side = NULL) { result <- build_table(lyt = lyt, df = anl, alt_counts_df = alt_counts_df) @@ -581,6 +586,7 @@ do_call <- function(fun, ...) { #' @param arm Arm variable for column split #' @param split_by_study, if true, construct structured header with the study ID #' @param side_by_side A logical value indicating whether to display the data side by side. +#' @return A `rtables` layout with desired header. #' @export build_table_header <- function(anl, arm, diff --git a/inst/WORDLIST b/inst/WORDLIST index aec657a0..e1bc2f87 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -65,9 +65,13 @@ ppt rds rtable rtables +rlistings scaler surv tlg +TLGs yaml yml yyyy +BioStat +labelled diff --git a/man/autoslider.core-package.Rd b/man/autoslider.core-package.Rd index 544ffad3..5a2d2d6e 100644 --- a/man/autoslider.core-package.Rd +++ b/man/autoslider.core-package.Rd @@ -6,12 +6,13 @@ \alias{autoslider.core-package} \title{autoslider.core Package} \description{ -Slides automation with R. +The normal process of creating clinical study slides is that a statistician manually type in the numbers from outputs and a separate statistician to double check the typed in numbers. This process is time consuming, resource intensive, and error prone. Automatic slide generation is a solution to address these issues. It reduces the amount of work and the required time when creating slides, and reduces the risk of errors from manually typing or copying numbers from the output to slides. It also helps users to avoid unnecessary stress when creating large amounts of slide decks in a short time window. } \seealso{ Useful links: \itemize{ \item \url{https://github.com/insightsengineering/autoslider.core} + \item Report bugs at \url{https://github.com/insightsengineering/autoslider.core/issues} } } diff --git a/man/autoslider_error.Rd b/man/autoslider_error.Rd index f58f7b56..c94ca4d3 100644 --- a/man/autoslider_error.Rd +++ b/man/autoslider_error.Rd @@ -13,6 +13,9 @@ autoslider_error(x, spec, step) \item{step}{step is a character indicating in which step the pipeline encounter error} } +\value{ +autoslider_error object +} \description{ autoslider_error class } diff --git a/man/autoslider_format.Rd b/man/autoslider_format.Rd index dd29e98f..efa49aec 100644 --- a/man/autoslider_format.Rd +++ b/man/autoslider_format.Rd @@ -57,6 +57,9 @@ black_format(ft, ...) \item{header_vals}{Header} } +\value{ +A flextable with applied theme. +} \description{ Zebra themed color } diff --git a/man/build_table_header.Rd b/man/build_table_header.Rd index caa93061..f4a35b4e 100755 --- a/man/build_table_header.Rd +++ b/man/build_table_header.Rd @@ -15,6 +15,9 @@ build_table_header(anl, arm, split_by_study, side_by_side) \item{side_by_side}{A logical value indicating whether to display the data side by side.} } +\value{ +A `rtables` layout with desired header. +} \description{ Build table header, a utility function to help with construct structured header for table layout } diff --git a/man/check_and_set_cutoff.Rd b/man/check_and_set_cutoff.Rd index 2cea6a8f..fd8bed9c 100644 --- a/man/check_and_set_cutoff.Rd +++ b/man/check_and_set_cutoff.Rd @@ -11,6 +11,9 @@ check_and_set_cutoff(data, cutoff) \item{cutoff}{cutoff threshold} } +\value{ +Set the cutoff value +} \description{ Assert function to check the cutoff } diff --git a/man/dec_paste.Rd b/man/dec_paste.Rd index 0aa90ce8..f04ffca8 100644 --- a/man/dec_paste.Rd +++ b/man/dec_paste.Rd @@ -9,6 +9,9 @@ dec_paste(...) \arguments{ \item{...}{arguments passed to program} } +\value{ +No return value, called for side effects +} \description{ Concatenate arguments into a string } diff --git a/man/decorate-VTableTree-method.Rd b/man/decorate-VTableTree-method.Rd index c556a67e..c0ef0128 100644 --- a/man/decorate-VTableTree-method.Rd +++ b/man/decorate-VTableTree-method.Rd @@ -19,6 +19,9 @@ \item{...}{Additional arguments passed to the decoration function.} } +\value{ +No return value, called for side effects +} \description{ Decorate TableTree } diff --git a/man/decorate-listing_df-method.Rd b/man/decorate-listing_df-method.Rd index 72220a7a..4de12015 100644 --- a/man/decorate-listing_df-method.Rd +++ b/man/decorate-listing_df-method.Rd @@ -19,6 +19,9 @@ \item{...}{Additional arguments. not used.} } +\value{ +No return value, called for side effects +} \description{ decorate listing } diff --git a/man/decorate.Rd b/man/decorate.Rd index 1f2f1e02..dac6eb6c 100644 --- a/man/decorate.Rd +++ b/man/decorate.Rd @@ -13,6 +13,9 @@ decorate(x, ...) \item{...}{additional arguments passed to methods} } +\value{ +No return value, called for side effects +} \description{ generic function decorate diff --git a/man/decorate.autoslider_error.Rd b/man/decorate.autoslider_error.Rd index 78a792ba..ef4d9eab 100644 --- a/man/decorate.autoslider_error.Rd +++ b/man/decorate.autoslider_error.Rd @@ -11,6 +11,9 @@ decorate.autoslider_error(x, ...) \item{...}{additional arguments. not used.} } +\value{ +No return value, called for side effects +} \description{ decorate method for autoslider_error class } diff --git a/man/decorate.default.Rd b/man/decorate.default.Rd index 7448aa96..dfbdb64b 100644 --- a/man/decorate.default.Rd +++ b/man/decorate.default.Rd @@ -11,6 +11,9 @@ decorate.default(x, ...) \item{...}{additional arguments. not used.} } +\value{ +No return value, called for side effects +} \description{ default method to decorate } diff --git a/man/decorate.ggplot.Rd b/man/decorate.ggplot.Rd index 6f2f96cb..aa14c340 100644 --- a/man/decorate.ggplot.Rd +++ b/man/decorate.ggplot.Rd @@ -26,6 +26,9 @@ decorate.ggplot( \item{...}{additional arguments. not used.} } +\value{ +No return value, called for side effects +} \description{ Decorate ggplot object } diff --git a/man/decorate.grob.Rd b/man/decorate.grob.Rd index 9bfce4ff..c9f75a1b 100644 --- a/man/decorate.grob.Rd +++ b/man/decorate.grob.Rd @@ -19,6 +19,9 @@ decorate.grob(x, titles, footnotes, paper = "L11", for_test = FALSE, ...) \item{...}{Additional arguments. not used.} } +\value{ +No return value, called for side effects +} \description{ decorate grob } diff --git a/man/decorate.list.Rd b/man/decorate.list.Rd index 7a3f71cb..02e620d9 100644 --- a/man/decorate.list.Rd +++ b/man/decorate.list.Rd @@ -19,6 +19,9 @@ decorate.list(x, titles, footnotes, paper = "L11", for_test = FALSE, ...) \item{...}{additional arguments. not used} } +\value{ +No return value, called for side effects +} \description{ decorate list of grobs } diff --git a/man/decorate_outputs.Rd b/man/decorate_outputs.Rd index 617ebf28..abd1a375 100644 --- a/man/decorate_outputs.Rd +++ b/man/decorate_outputs.Rd @@ -23,6 +23,9 @@ decorate_outputs( \item{for_test}{`logic` CICD parameter} } +\value{ +No return value, called for side effects +} \description{ Decorate outputs with titles and footnotes } diff --git a/man/fastDoCall.Rd b/man/fastDoCall.Rd index ba91074b..7fa2d753 100644 --- a/man/fastDoCall.Rd +++ b/man/fastDoCall.Rd @@ -16,6 +16,9 @@ fastDoCall(what, args, quote = FALSE, envir = parent.frame()) \item{envir}{an environment within which to evaluate the call. This will be most useful if what is a character string and the arguments are symbols or quoted expressions.} } +\value{ +No return value, called for side effects +} \description{ copied from ms showcase app } diff --git a/man/filter_spec.Rd b/man/filter_spec.Rd index c69bf14b..219482a4 100644 --- a/man/filter_spec.Rd +++ b/man/filter_spec.Rd @@ -24,10 +24,6 @@ Filter a spec object library(dplyr) spec_file <- system.file("spec.yml", package = "autoslider.core") spec <- spec_file \%>\% read_spec() -## Keep only outputs belonging to batch 2 -\dontrun{ -filter_spec(spec, batch == 2) -} ## Keep only the t_dm_IT output filter_spec(spec, output == "t_dm_IT") diff --git a/man/format_3d.Rd b/man/format_3d.Rd index cdf64bde..e57846b8 100644 --- a/man/format_3d.Rd +++ b/man/format_3d.Rd @@ -11,6 +11,9 @@ format_3d(x, output) \item{output}{output handle} } +\value{ +formatted values +} \description{ Format of xx.xx (xx.xx, xx.xx) } diff --git a/man/generate_output.Rd b/man/generate_output.Rd index 9850cf1a..260c6666 100644 --- a/man/generate_output.Rd +++ b/man/generate_output.Rd @@ -17,6 +17,9 @@ generate_output(program, datasets, spec, verbose_level = 2, ...) \item{...}{arguments passed to program} } +\value{ +No return value, called for side effects +} \description{ Generate output and apply filters, titles, and footnotes } diff --git a/man/generate_outputs.Rd b/man/generate_outputs.Rd index 49d9f028..ff62aa2e 100644 --- a/man/generate_outputs.Rd +++ b/man/generate_outputs.Rd @@ -13,6 +13,9 @@ generate_outputs(spec, datasets, verbose_level = 2) \item{verbose_level}{Verbose level of messages be displayed. See details for further information.} } +\value{ +No return value, called for side effects +} \description{ Generate all outputs from a spec } diff --git a/man/generate_slides.Rd b/man/generate_slides.Rd index 2757d2de..9caa2710 100644 --- a/man/generate_slides.Rd +++ b/man/generate_slides.Rd @@ -6,7 +6,7 @@ \usage{ generate_slides( outputs, - outfile = "output.pptx", + outfile = paste0(tempdir(), "/output.pptx"), template = file.path(system.file(package = "autoslider.core"), "theme/basic.pptx"), fig_width = 9, fig_height = 6, @@ -42,6 +42,9 @@ Specify this optional argument to modify the width of all of the listings displa \item{...}{arguments passed to program} } +\value{ +No return value, called for side effects +} \description{ generate slides based on output } diff --git a/man/lyt_to_side_by_side.Rd b/man/lyt_to_side_by_side.Rd index 4f0aa2d6..bd783e89 100644 --- a/man/lyt_to_side_by_side.Rd +++ b/man/lyt_to_side_by_side.Rd @@ -13,6 +13,9 @@ lyt_to_side_by_side(lyt, anl, side_by_side = NULL) \item{side_by_side}{A logical value indicating whether to display the data side by side.} } +\value{ +An `rtables` layout +} \description{ Build side by side layout by cbind } diff --git a/man/lyt_to_side_by_side_two_data.Rd b/man/lyt_to_side_by_side_two_data.Rd index f5b90391..898e711e 100644 --- a/man/lyt_to_side_by_side_two_data.Rd +++ b/man/lyt_to_side_by_side_two_data.Rd @@ -15,6 +15,9 @@ lyt_to_side_by_side_two_data(lyt, anl, alt_counts_df, side_by_side = NULL) \item{side_by_side}{A logical value indicating whether to display the data side by side.} } +\value{ +An `rtables` layout +} \description{ Build side by side layout by cbind } diff --git a/man/mutate_actarm.Rd b/man/mutate_actarm.Rd index ee12b4e4..cb2441d3 100644 --- a/man/mutate_actarm.Rd +++ b/man/mutate_actarm.Rd @@ -21,6 +21,9 @@ mutate_actarm( \item{labels}{factor labels} } +\value{ +Dataframe with re-level and re-labelled arm variable. +} \description{ Refactor active arm } diff --git a/man/na_replace.Rd b/man/na_replace.Rd index 42dcd037..2d5bf5ff 100644 --- a/man/na_replace.Rd +++ b/man/na_replace.Rd @@ -9,6 +9,9 @@ na_replace(table_df) \arguments{ \item{table_df}{Table dataframe} } +\value{ +Input dataframe with both column replaced to NA +} \description{ Replace NAs to NA } diff --git a/man/new_round.Rd b/man/new_round.Rd index 9b39c55c..713c56bd 100755 --- a/man/new_round.Rd +++ b/man/new_round.Rd @@ -11,6 +11,9 @@ new_round(x, digits = 1) \item{digits}{number of digits} } +\value{ +rounded value +} \description{ Founding method } diff --git a/man/null_report.Rd b/man/null_report.Rd index 23ddce05..940de7a4 100755 --- a/man/null_report.Rd +++ b/man/null_report.Rd @@ -6,6 +6,9 @@ \usage{ null_report() } +\value{ +An empty `rtables` object +} \description{ Null report } diff --git a/man/perc_perc.Rd b/man/perc_perc.Rd index 0b62660c..c356f8d5 100644 --- a/man/perc_perc.Rd +++ b/man/perc_perc.Rd @@ -11,6 +11,9 @@ perc_perc(x, output) \item{output}{output handle} } +\value{ +formatted values +} \description{ Format of (xx\%, xx\%) } diff --git a/man/ph_with_img.Rd b/man/ph_with_img.Rd index a28aba1b..6866fe25 100644 --- a/man/ph_with_img.Rd +++ b/man/ph_with_img.Rd @@ -17,6 +17,9 @@ ph_with_img(ppt, figure, fig_width, fig_height, figure_loc) \item{figure_loc}{location of figure} } +\value{ +Location for a placeholder +} \description{ Placeholder for ph_with_img } diff --git a/man/preprocess_t_dd.Rd b/man/preprocess_t_dd.Rd index d942ac20..7bc797e9 100644 --- a/man/preprocess_t_dd.Rd +++ b/man/preprocess_t_dd.Rd @@ -17,6 +17,9 @@ preprocess_t_dd( \item{labels}{factor labels} } +\value{ +dataframe +} \description{ Preprocess t_dd function } diff --git a/man/preprocess_t_ds.Rd b/man/preprocess_t_ds.Rd index ef9e8b55..430a1174 100644 --- a/man/preprocess_t_ds.Rd +++ b/man/preprocess_t_ds.Rd @@ -17,6 +17,9 @@ preprocess_t_ds( \item{labels}{factor labels} } +\value{ +dataframe +} \description{ Preprocess t_ds function } diff --git a/man/print.decoratedGrob.Rd b/man/print.decoratedGrob.Rd index a273eb16..647d3ca3 100644 --- a/man/print.decoratedGrob.Rd +++ b/man/print.decoratedGrob.Rd @@ -11,6 +11,9 @@ \item{...}{not used.} } +\value{ +No return value, called for side effects +} \description{ Print decorated grob } diff --git a/man/print.decoratedGrobSet.Rd b/man/print.decoratedGrobSet.Rd index 9c5ed2f1..fd66328e 100644 --- a/man/print.decoratedGrobSet.Rd +++ b/man/print.decoratedGrobSet.Rd @@ -11,6 +11,9 @@ \item{...}{not used.} } +\value{ +No return value, called for side effects +} \description{ Print decorated grob set } diff --git a/man/s_proportion_1.Rd b/man/s_proportion_1.Rd index 3cf7341d..ae62d389 100644 --- a/man/s_proportion_1.Rd +++ b/man/s_proportion_1.Rd @@ -20,6 +20,10 @@ s_proportion_1( \item{long}{flag} } +\value{ +A function suitable for use in rtables::analyze() with element selection, +reformatting, and relabeling performed automatically. +} \description{ survival proportion afun } diff --git a/man/s_surv_time_1.Rd b/man/s_surv_time_1.Rd index 1dcadec5..7c25ddf0 100644 --- a/man/s_surv_time_1.Rd +++ b/man/s_surv_time_1.Rd @@ -15,6 +15,10 @@ s_surv_time_1(df, .var, is_event, control = control_surv_time()) \item{control}{`control_surv_time()` by default} } +\value{ +A function suitable for use in rtables::analyze() with element selection, +reformatting, and relabeling performed automatically. +} \description{ survival time afun } diff --git a/man/save_output.Rd b/man/save_output.Rd index e72fb629..1b73a9b5 100755 --- a/man/save_output.Rd +++ b/man/save_output.Rd @@ -34,6 +34,14 @@ save_output.dlisting(output, file_name, save_rds = TRUE) \item{save_rds}{Saved as an `.rds` files} } \value{ +The input `object` invisibly + +No return value, called for side effects + +The input `object` invisibly + +The input `object` invisibly + The input `object` invisibly } \description{ diff --git a/man/save_outputs.Rd b/man/save_outputs.Rd index f3050458..0121b938 100644 --- a/man/save_outputs.Rd +++ b/man/save_outputs.Rd @@ -25,6 +25,9 @@ in addition to `.out` or `.pdf` files? Defaults to `FALSE`.} \item{verbose_level}{Level of verbose information displayed. Default set to `1`.} } +\value{ +The input `object` invisibly +} \description{ Save a list of outputs } diff --git a/man/slides_preview.Rd b/man/slides_preview.Rd index 879f15bc..a1d9c618 100644 --- a/man/slides_preview.Rd +++ b/man/slides_preview.Rd @@ -9,6 +9,9 @@ slides_preview(x) \arguments{ \item{x}{rtables or data.frame} } +\value{ +A flextable or a ggplot object depending to the input. +} \description{ Generate flextable for preview first page } diff --git a/man/t_ae_pt_slide.Rd b/man/t_ae_pt_slide.Rd index 82d2fa20..c454a5d3 100644 --- a/man/t_ae_pt_slide.Rd +++ b/man/t_ae_pt_slide.Rd @@ -52,7 +52,7 @@ adae <- eg_adae \%>\% ) out <- t_ae_pt_slide(adsl, adae, "TRT01A", 2) print(out) -generate_slides(out, "ae.pptx") +generate_slides(out, paste0(tempdir(), "/ae.pptx")) # Example 2, prune by total column out2 <- t_ae_pt_slide(adsl, adae, "TRT01A", 25, prune_by_total = TRUE) diff --git a/man/t_ae_pt_soc_slide.Rd b/man/t_ae_pt_soc_slide.Rd index f3c5c3d1..e89d69da 100644 --- a/man/t_ae_pt_soc_slide.Rd +++ b/man/t_ae_pt_soc_slide.Rd @@ -47,7 +47,7 @@ adae <- eg_adae \%>\% ) out <- t_ae_pt_soc_slide(adsl, adae, "TRT01A", 2) print(out) -generate_slides(out, "ae.pptx") +generate_slides(out, paste0(tempdir(), "/ae.pptx")) # Example 2, prune by total column diff --git a/man/t_dor_slide.Rd b/man/t_dor_slide.Rd index eb1ac5c3..b67e75f5 100644 --- a/man/t_dor_slide.Rd +++ b/man/t_dor_slide.Rd @@ -15,6 +15,9 @@ t_dor_slide(adsl, adtte, arm = "TRT01P", refgroup = NULL) \item{refgroup}{Reference group} } +\value{ +An `rtables` object +} \description{ DOR table } diff --git a/man/to_vector.Rd b/man/to_vector.Rd index 383d5dc2..889ce238 100644 --- a/man/to_vector.Rd +++ b/man/to_vector.Rd @@ -9,6 +9,9 @@ to_vector(num_list) \arguments{ \item{num_list}{list of numbers} } +\value{ +No return value, called for side effects +} \description{ Convert list of numbers to vectors } diff --git a/man/trim_perc.Rd b/man/trim_perc.Rd index d6c0ea27..b6c44a3c 100644 --- a/man/trim_perc.Rd +++ b/man/trim_perc.Rd @@ -11,6 +11,9 @@ trim_perc(x, output) \item{output}{output handle} } +\value{ +formatted values +} \description{ Format of xx.xx (xx.x) } diff --git a/man/trim_perc1.Rd b/man/trim_perc1.Rd index 4c482a70..f9e42a23 100644 --- a/man/trim_perc1.Rd +++ b/man/trim_perc1.Rd @@ -11,6 +11,9 @@ trim_perc1(x, output) \item{output}{output handle} } +\value{ +formatted values +} \description{ Format of xx.xx (xx.xx) }