Skip to content

Commit

Permalink
[skip style] [skip vbump] Restyle files
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 5, 2024
1 parent 8386dd9 commit 3090db7
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions vignettes/tern_functions_guide.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,20 @@ fix_layout %>%
summarize_change("CHG", variables = list(value = "AVAL", baseline_flag = "ABLFLL"), na_str = "my_na") %>%
build_table(dta_test) %>%
print()
```

`.formats`, `.labels`, and `.indent_mods` depend on the names of `.stats`. Here is how you can change the default formatting.

```{r}
# changing n count format and label and indentation
fix_layout %>%
summarize_change("CHG", variables = list(value = "AVAL", baseline_flag = "ABLFLL"),
.stats = c("n", "mean"), # reducing the number of stats for visual appreciation
.formats = c(n = "xx.xx"),
.labels = c(n = "NnNn"),
.indent_mods = c(n = 5), na_str = "nA") %>%
summarize_change("CHG",
variables = list(value = "AVAL", baseline_flag = "ABLFLL"),
.stats = c("n", "mean"), # reducing the number of stats for visual appreciation
.formats = c(n = "xx.xx"),
.labels = c(n = "NnNn"),
.indent_mods = c(n = 5), na_str = "nA"
) %>%
build_table(dta_test) %>%
print()
```
Expand All @@ -105,9 +106,11 @@ What if I want something special for the format?
```{r}
# changing n count format and label and indentation
fix_layout %>%
summarize_change("CHG", variables = list(value = "AVAL", baseline_flag = "ABLFLL"),
.stats = c("n", "mean"), # reducing the number of stats for visual appreciation
.formats = c(n = function(x, ...) as.character(x * 100))) %>% # Note you need ...!!!
summarize_change("CHG",
variables = list(value = "AVAL", baseline_flag = "ABLFLL"),
.stats = c("n", "mean"), # reducing the number of stats for visual appreciation
.formats = c(n = function(x, ...) as.character(x * 100))
) %>% # Note you need ...!!!
build_table(dta_test) %>%
print()
```
Expand Down

0 comments on commit 3090db7

Please sign in to comment.