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
### Change these parts here ---------------------------------------------------- | |
# Set to your working directory where there is a template.md file | |
setwd(here::here()) | |
# Locations | |
vault_location <- stop('Add Vault Location') # Location of markdown files | |
attachments_dir <- stop('Add Vault Subdirectory Location') # subdirectory of vault_location for png-files | |
imap_mail <- stop('Set imap mail client') # mail client |
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) | |
dat <- mpg %>% | |
mutate( | |
custom_color = if_else( | |
year == 2008 & manufacturer == 'audi', | |
'dodgerblue4', | |
'grey80' | |
) | |
) |
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
--- | |
output: html_document | |
editor_options: | |
chunk_output_type: console | |
--- | |
This is based on Nicola Rennie's blog post https://nrennie.rbind.io/blog/2022-06-06-creating-flowcharts-with-ggplot2/ | |
The flowchart is taken from https://imgur.com/gallery/79VHL |
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
camcorder::gg_record( | |
dir = 'img', | |
height = 16, | |
width = 16, | |
units = 'cm' | |
) | |
library(tidyverse) | |
library(ggforce) | |
dat <- tibble( |
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
--- | |
output: html_document | |
editor_options: | |
chunk_output_type: console | |
--- | |
## Load Packages | |
```{r} | |
setwd(here::here('streep_map_game/')) |
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) | |
color_palette <- thematic::okabe_ito(8) | |
flights <- nycflights13::flights | |
counts <- flights %>% | |
mutate( | |
date = lubridate::make_date(year = year, month = month, day = day) | |
) %>% | |
count(date) %>% | |
mutate( |
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
--- | |
output: html_document | |
editor_options: | |
chunk_output_type: console | |
--- | |
```{r} | |
setwd(here::here('stacked_bar_alternative/')) | |
camcorder::gg_record( | |
dir = 'img', |
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
```{r} | |
#| message: false | |
library(tidyverse) | |
``` | |
::: panel-tabset | |
## Responsive |
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) | |
# GOAL: Center and standardize every numeric column but `year` (by species and island) | |
palmerpenguins::penguins | |
# # A tibble: 344 x 8 | |
# species island bill_length_mm bill_depth_mm flipper_length_mm body_mass_g sex year | |
# <fct> <fct> <dbl> <dbl> <int> <int> <fct> <int> | |
# 1 Adelie Torgersen 39.1 18.7 181 3750 male 2007 | |
# 2 Adelie Torgersen 39.5 17.4 186 3800 female 2007 |
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
setwd(here::here('shiny_modules')) | |
library(shiny) | |
library(ggplot2) | |
ui <- fluidPage( | |
theme = bslib::bs_theme( | |
# Colors (background, foreground, primary) | |
bg = 'white', | |
fg = '#06436e', | |
primary = colorspace::lighten('#06436e', 0.3), |
OlderNewer