library(tidyverse)
library(broom)
library(parameters)
library(marginaleffects)
library(palmerpenguins)
penguins <- penguins |>
drop_na(sex) |>
mutate(is_gentoo = species == "Gentoo")
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
| matches: | |
| # Markdown / HTML things | |
| - trigger: ";mdl" | |
| replace: "[$|$]({{clipb}})" | |
| vars: | |
| - name: "clipb" | |
| type: "clipboard" | |
| - trigger: ";br" | |
| replace: "<br>" |
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) | |
| library(gutenbergr) | |
| constitution_raw <- gutenberg_download(5) | |
| constitution <- constitution_raw |> | |
| slice(36:546) |> | |
| filter(text != "") |> | |
| mutate(text_lc = str_to_lower(text)) |> | |
| mutate(is_article = str_starts(text_lc, "article")) |> |
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) | |
| library(readxl) | |
| library(tinytable) | |
| # Load data downloaded from https://www.systemicpeace.org/inscrdata.html | |
| polity <- read_excel("~/Downloads/p5v2018.xls") |> | |
| mutate(polity_change = polity2 - lag(polity2), .by = scode) |> | |
| filter(year > 1800) | |
| # Find the biggest drops in polity scores since 1985 |
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
| #!/bin/bash | |
| # Required parameters: | |
| # @raycast.schemaVersion 1 | |
| # @raycast.title Toggle Litra | |
| # @raycast.mode silent | |
| # Optional parameters: | |
| # @raycast.icon 💡 |
library(tidyverse)
# Colors too dark
mtcars |>
mutate(carb = factor(carb)) |>
ggplot(aes(carb, fill = carb)) +
geom_bar() +
scale_fill_viridis_d(
option = "magma", begin = 0.1, end = 0.8library(tidyverse)
library(sf)
#> Linking to GEOS 3.11.0, GDAL 3.5.3, PROJ 9.1.0; sf_use_s2() is TRUE
library(rnaturalearth)
# All countries
countries <- ne_countries(scale = 50) |>
filter(iso_a3 != "ATA")library(tidyverse)
# Example data
plot_data <- mpg |>
mutate(cyl = factor(cyl)) |>
group_by(cyl) |>
summarize(n = n())
# ew that yellow is gross
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: Panel tabset from list of plots | |
| --- | |
| ```{r} | |
| #| warning: false | |
| #| message: false | |
| library(tidyverse) | |
| library(glue) |