Skip to content

Commit 8551308

Browse files
committed
add variable label, remove unused arguments
1 parent 25bc93f commit 8551308

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

R/fda-table_02.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ make_table_02 <- function(df,
7878

7979
if (return_ard) {
8080
ard <- gtsummary::gather_ard(tbl)
81-
res <- list(tbl = tbl, ard = ard)
81+
return(list(table = tbl, ard = ard))
8282
} else {
83-
res <- list(tbl = tbl)
83+
return(tbl)
8484
}
8585
}
8686

quarto/table-templates/template-table_02.qmd

+1-5
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ adsl <- adsl %>%
3030
AGE >= 65 & AGE < 75 ~ ">=65 to <75",
3131
AGE >= 75 ~ ">=75"
3232
)))
33-
33+
attr(adsl$AGEGR1, "label") <- "Age Group"
3434
3535
# Output Table
3636
make_table_02(
@@ -63,7 +63,6 @@ Required variables:
6363
| **Argument** | **Description** | **Default** |
6464
| `df` | (`data.frame`) Dataset (typically ADSL) required to build table. | *No default* |
6565
| `return_ard` | (`flag`) Whether an ARD should be returned. | `TRUE` |
66-
| `denominator` | (`character`) Alternative dataset used only to calculate column counts. | `NULL` |
6766
| `arm_var` | (`character`) Arm variable used to split table into columns. | `"ARM"` |
6867
| `saffl_var` | (`character`) Flag variable used to indicate inclusion in safety population. | `"SAFFL"` |
6968
| `id_var` | (`character`) Identifier variable used to count the participants within each flag. | `"USUBJID"` |
@@ -174,15 +173,12 @@ Required variables:
174173
| **Argument** | **Description** | **Default** |
175174
|:-----------------------|:-----------------------|:-----------------------|
176175
| `df` | (`data.frame`) Dataset (typically ADSL) required to build table. | *No default* |
177-
| `alt_counts_df` | (`character`) Alternative dataset used only to calculate column counts. | `NULL` |
178176
| `show_colcounts` | (`flag`) Whether column counts should be printed. | `TRUE` |
179177
| `arm_var` | (`character`) Arm variable used to split table into columns. | `"ARM"` |
180178
| `saffl_var` | (`character`) Flag variable used to indicate inclusion in safety population. | `"SAFFL"` |
181179
| `vars` | (`character`) Variables from `df` to include in the table. | `c("SEX", "AGE", "AGEGR1", "RACE", "ETHNIC", "COUNTRY")` |
182180
| `lbl_vars` | (`character`) Labels corresponding to variables in `vars` to print in the table. Labels should be ordered according to the order of variables in `vars`. | `formatters::var_labels(df, fill = TRUE)[vars]` |
183181
| `lbl_overall` | (`character`) If specified, an overall column will be added to the table with the given value as the column label. | `"Total Population"` |
184-
| `.stats` | (`character`) Statistics to include in the table. Includes statistics for all variable types (only the statistics that are valid for a given variable's type will be printed). See [`tern::analyze_vars()`](https://insightsengineering.github.io/tern/main/reference/analyze_variables.html#value) for options. | `c("mean_sd", "median_range", "count_fraction")` |
185-
| `.formats` | (named `list` of `character`) List of formats corresponding to each value in `.stats`. Each name is a value in `.stats` and the corresponding value is the format that should be applied to that statistic. See [`formatters::list_valid_format_labels()`](https://insightsengineering.github.io/formatters/main/reference/list_valid_format_labels.html#ref-examples) for a list of valid formats. | `NULL` |
186182
| `prune_0` | (`flag`) Whether all-zero rows should be removed from the table. | `TRUE` |
187183
| `na_rm` | (`flag`) Whether `NA` levels should be removed from the table. | `FALSE` |
188184
| `annotations` | (named `list` of `character`) List of annotations to add to the table. Valid annotation types are `title`, `subtitles`, `main_footer`, and `prov_footer.` Each name-value pair should use the annotation type as name and the desired string as value. | `NULL` |

0 commit comments

Comments
 (0)