This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iris_e <- iris | |
str(iris_e) | |
# from factor to character | |
iris_e <- iris_e %>% dplyr::mutate(tidyselect::across(tidyselect::where(is.factor), as.character)) | |
str(iris_e) | |
# from character to factor | |
iris_e <- iris_e %>% dplyr::mutate(tidyselect::across(tidyselect::where(is.character), as.factor)) | |
str(iris_e) | |
# remove all-NA columns |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# path | |
path_original <- setwd(path) | |
on.exit(setwd(path_original), add = TRUE) | |
## Example error capture | |
# First check if effect is involved in interactions | |
check_message <- | |
e_message_capture( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://cran.r-project.org/web/packages/dplyr/vignettes/programming.html | |
# let var_xs and var_name_y be character strings with variable names, then: | |
geom_point( | |
data = dat_cont | |
, aes(x = !!rlang::sym(var_xs), y = !!rlang::sym(var_name_y)) | |
, alpha = geom_point_alpha | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: Title | |
subtitle: Subtitle | |
description: | | |
A qmd quarto template document. | |
abstract: | | |
Document abstract may be somewhat long. | |
author: | |
- name: Erik Erhardt | |
url: https://StatAcumen.com/about |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: Title | |
subtitle: Subtitle | |
author: Erik Erhardt | |
date: last-modified # today, now, last-modified | |
date-format: long # full, long, medium, short, iso, https://quarto.org/docs/reference/dates.html | |
format: | |
html: | |
theme: litera | |
highlight-style: atom-one |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: Tables using `gtsummary` | |
subtitle: Example workflow for Table 1 (demographics), regression, contingency table, etc. | |
author: Erik Erhardt | |
date: last-modified # today, now, last-modified | |
date-format: long # full, long, medium, short, iso, https://quarto.org/docs/reference/dates.html | |
format: | |
html: | |
theme: litera | |
highlight-style: atom-one |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Read current files | |
# Assumed file naming structure is Filename_YYYYMMDD.csv | |
# list of all files | |
fn_list_data_raw <- dir("data/") | |
# filenames to match | |
fn_dat_list_in <- | |
c( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from inline to yaml chunk options | |
knitr::convert_chunk_header() | |
# Verbatim engine for instruction | |
# https://bookdown.org/yihui/rmarkdown-cookbook/verbatim-code-chunks.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
quarto titlepages v3.0: Demo of customizing a title page | |
https://youtu.be/SZ0WJMHGDps | |