Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@ Encoding: UTF-8
Language: en-US
LazyData: true
LazyDataCompression: xz
RoxygenNote: 7.3.2
RoxygenNote: 7.3.3
2 changes: 1 addition & 1 deletion R/appendix.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ postprocessing_doc <- function(doc, save_file, doc_o, type = "") {
#' @examples
#' example <- tempfile(fileext = ".pptx")
#' doc <- officer::read_pptx()
#' doc <- officer::add_slide(doc, layout = "Title and Content")
#' doc <- officer::add_slide(doc)
#' print(doc, target = example)
#' doc <- initialize_doc_original(NULL, example)
initialize_doc_original <- function(doc_original, doc_o) {
Expand Down
2 changes: 1 addition & 1 deletion man/format_date.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/g_eg_slide.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/g_lb_slide.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/g_mean_general.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/g_vs_slide.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/generate_output.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/generate_outputs.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/generate_slides.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/initialize_doc_original.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/null_report.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/save_outputs.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/slides_from_rds.Rd

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

27 changes: 7 additions & 20 deletions vignettes/tlg_templates.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,9 @@ library(assertthat) # For assert_that() you had issues with before

```{r_function_call, include = TRUE}
use_template(template = "t_dm_slide", function_name = "demography")

```
This will create a file with the demography template at `./programs/R/demography.R`, whose contents are displayed below.
```{r, include = TRUE}
library(dplyr)
library(autoslider.core)
demography <- function(adsl,
arm = "TRT01P",
vars = c("AGE", "SEX", "RACE"),
Expand Down Expand Up @@ -192,25 +189,15 @@ demography <- function(adsl,
}

```


```{r, include = FALSE}
library(autoslider.core)
adsl <- eg_adsl
```
Processing our data with the generated `t_dm_slide` script would look like:
```{r}
filters::load_filters(filters, overwrite = TRUE)
# read data
data <- list(
"adsl" = eg_adsl %>%
mutate(
FASFL = SAFFL, # add FASFL for illustrative purpose for t_pop_slide
# DISTRTFL is needed for t_ds_slide but is missing in example data
DISTRTFL = sample(c("Y", "N"), size = length(TRT01A), replace = TRUE, prob = c(.1, .9))
) %>%
preprocess_t_ds(), # this preproccessing is required by one of the autoslider.core functions
"adae" = eg_adae,
"adtte" = eg_adtte,
"adrs" = eg_adrs,
"adlb" = eg_adlb
)
demography(data$adsl)

demography(adsl)
```
Following this process, you have successfully generated a reusable `demography` function that processes clinical data, and convert it into a standard demographic table, including statistical insights like range, median, and count fractions to variables AGE, SEX, and RACE.

Expand Down
Loading