This file contains hidden or 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 <https://github.com/tidymodels/TMwR/blob/master/index.Rmd> | |
| ```{r pkg-list, echo = FALSE, results="asis"} | |
| deps <- desc::desc_get_deps() | |
| pkgs <- sort(deps$package[deps$type == "Imports"]) | |
| pkgs <- sessioninfo::package_info(pkgs, dependencies = FALSE) | |
| df <- tibble::tibble( | |
| package = pkgs$package, | |
| version = pkgs$ondiskversion, | |
| source = gsub("@", "\\\\@", pkgs$source) | |
| ) |
This file contains hidden or 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) | |
| # Sys.unsetenv('GITHUB_PAT') | |
| # remotes::install_github('https://github.com/hrbrmstr/waffle') | |
| library(waffle) | |
| ## <https://www.npr.org/sections/goatsandsoda/2021/08/20/1029628471/highly-vaccinated-israel-is-seeing-a-dramatic-surge-in-new-covid-cases-heres-why> | |
| ## "half of Israel's seriously ill patients who are currently hospitalized were fully vaccinated at least five months ago" | |
| # vaxx rate: 78% |
This file contains hidden or 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) | |
| theme_set(theme_minimal()) | |
| library(broom) | |
| one_sim = function(id, n = 100) { | |
| dataf = tibble(x1 = rnorm(n, 0, 1), | |
| x2 = rnorm(n, 0, 1), | |
| eps = rnorm(n, 0, .1), | |
| y = 1 + x1 + 3*x1*x2 + eps) | |
| coef_df = lm(y ~ x1 + x2, dataf) |> |
This file contains hidden or 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
| /*-- scss:rules --*/ | |
| .mermaid svg { | |
| max-width: 100%; | |
| height: auto; | |
| } | |
| #Argument rect { | |
| stroke:transparent; | |
| fill:#e5e5e5!important; | |
| } |
This file contains hidden or 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) | |
| ## Parameters ---- | |
| ## How many people have questions? | |
| n_questions = 30 | |
| ## How many questions will actually get answered? | |
| max_questions = 15 | |
| ## How many times to run the simulation? | |
| N = 500 |
This file contains hidden or 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(magrittr) | |
| ## Given a vector, calculate both the mean and standard deviation | |
| mean_sd = function(vec) { | |
| list(mean = mean(vec), | |
| sd = sd(vec)) | |
| } | |
| d20 = function() sample.int(20, 1) |
This file contains hidden or 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: "Samples can be smaller than you think" | |
| output: | |
| flexdashboard::flex_dashboard: | |
| vertical_layout: scroll | |
| runtime: shiny | |
| --- | |
| ```{r setup, include = FALSE} | |
| library(tidyverse) |
OlderNewer