Skip to content

Instantly share code, notes, and snippets.

View mine-cetinkaya-rundel's full-sized avatar

Mine Cetinkaya-Rundel mine-cetinkaya-rundel

View GitHub Profile
@mine-cetinkaya-rundel
mine-cetinkaya-rundel / code-highlighting-example.qmd
Last active October 1, 2023 14:50
Potential solutions for https://elk.zone/fosstodon.org/@3mma@mastodon.social/111159483378645767
---
format: revealjs
execute:
echo: true
engine: knitr
---
# Option 1: `code-line-numbers`
## RStudio Projects
@mine-cetinkaya-rundel
mine-cetinkaya-rundel / multiple-chunks-highlight-revealjs.qmd
Created November 20, 2022 20:39
Highlighting across multiple code chunks in a Quarto revealjs presentation
---
format:
revealjs:
highlight-style: a11y-dark
execute:
echo: true
---
```{r}
#| code-line-numbers: "|1|2"
@mine-cetinkaya-rundel
mine-cetinkaya-rundel / tidypumpkin.R
Last active August 27, 2023 20:50
Code developed during the "Break it, fix it, trash it, change it, plot, update it" webinar
# Find on RStudio Cloud: https://bit.ly/tidypumpkin
# inspirations -----------------------------------------------------------------
# https://twitter.com/alyssastweeting/status/1450270826347913220
# https://twitter.com/Emma_McHuge/status/1450434288319537162
# load packages ----------------------------------------------------------------
library(tidyverse)
@mine-cetinkaya-rundel
mine-cetinkaya-rundel / lms-bs.R
Last active November 13, 2020 15:24
Merging assignment scores into a format your LMS requires
library(tidyverse)
lms_export <- tribble(
~Name, ~`Student ID`, ~`HW 01 [Total Pts: 100 Score] |so many more characters`, ~`and many more columns`,
"Dorianne Grey", 12345, NA, NA,
"Krista Rose", 67890, NA, NA
)
hw_scores <- tribble(
~student_id, ~score,
@mine-cetinkaya-rundel
mine-cetinkaya-rundel / learnr-dark.css
Created October 26, 2020 10:16
Sample (in no way perfect!) CSS for learnr tutorials with dark background
body {
font-size: 16px;
}
.topicsList .topic {
font-size: 18px;
}
p.caption {
font-size: 0.6em;
}
@mine-cetinkaya-rundel
mine-cetinkaya-rundel / the-one-with-the-most-words.R
Created September 5, 2020 22:50
The one with the most words
# Load packages ----------------------------------------------------------------
library(tidytext)
library(friends)
library(tidyverse)
# The six friends --------------------------------------------------------------
six_friends <- c("Phoebe Buffay", "Chandler Bing", "Rachel Green", "Monica Geller", "Joey Tribbiani", "Ross Geller")
@mine-cetinkaya-rundel
mine-cetinkaya-rundel / you-guys.R
Created August 31, 2020 13:51
Number of utterances of "you guys" from the Friends cast
library(friends) # devtools::install_github("EmilHvitfeldt/friends")
library(tidyverse)
you_guys <- friends %>%
mutate(text = tolower(text)) %>%
filter(str_detect(text, "you guys")) %>%
count(speaker, sort = TRUE)
you_guys
#> # A tibble: 70 x 2
---
output: learnr::tutorial
runtime: shiny_prerendered
---
```{r setup, include=FALSE}
library(learnr)
```
## Exercise with Hint
library(tidyverse)
library(rtweet)
library(glue)
tml <- get_timelines("JeffisTallguy", n = 200)
yesterday <- tml %>%
filter(is.na(reply_to_screen_name)) %>%
slice(
which(str_detect(text, "Yesterday by the Beatles is a pretty solid song")):
@mine-cetinkaya-rundel
mine-cetinkaya-rundel / learnr-hint.Rmd
Created August 12, 2020 09:18
learnr tutorial with hints
---
output: learnr::tutorial
runtime: shiny_prerendered
---
```{r setup, include=FALSE}
library(learnr)
```
## Exercise with Hint