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
library(ggplot2) | |
library(dplyr) | |
dd <- tibble( | |
x = 1:10, | |
y = runif(length(x)) | |
) | |
dd %>% | |
ggplot(aes(x, y)) + |
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
## Getting Standardized Betas | |
# Recall that standardized betas are: | |
# beta * (sx / sy) | |
# Where sx and sy are the standard deviations of X and Y | |
# Let's fit a simple model | |
mod <- lm(Sepal.Length ~ Sepal.Width, data = iris) | |
# Manual standardization after fitting model | |
betas <- coef(mod)[[2]] # extract beta |
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
library(tidyverse) | |
library(yardstick) | |
set.seed(123456) | |
xx <- | |
matrix(runif(100), nrow = 10) %>% | |
as_tibble() %>% | |
nest(x = everything()) | |
yy <- |
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: "Symposium on Data Science and Statistics (SDSS 2020)" | |
subtitle: "Submission and Formatting Instructions for Extended Abstracts" | |
author: | |
- name: First Author | |
affiliation: | |
- Affiliation 1 | |
- Affiliation 2 | |
email: email@domain | |
- name: Second Author |
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
#' Install version-locked packages and dependencies | |
#' | |
#' @description Install packages and dependencies based on the current version of R and its corresponding MRAN date. | |
#' | |
#' @param pkgs Charactor vector of package names. | |
#' @param quiet Logical. Should installation be done quietly? Default is TRUE. | |
#' | |
#' @details R versions and MRAN dates are based on the Rocker project (https://github.com/rocker-org/rocker-versioned/blob/master/VERSIONS.md). | |
#' | |
#' @author Matthew T. Warkentin, \email{warkentin@@lunenfeld.ca} |
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
library(dplyr) | |
library(ggplot2) | |
library(patchwork) | |
library(broom) | |
theme_set(theme_light()) | |
p1 <- anscombe %>% | |
ggplot(aes(x1, y1)) + | |
geom_point() + |
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
render_beamer <- function(input = NULL, cleanup = FALSE, ...){ | |
assertthat::assert_that(fs::file_exists(input)) | |
bare_input <- fs::path_ext_remove(input) | |
out_dir <- fs::path_dir(input) | |
rmarkdown::render(input, ...) | |
pre_dir <- rbind(tibble::enframe(fs::dir_ls(out_dir)), | |
glue::glue('{fs::as_fs_path(bare_input)}.pdf'), |