Skip to content

Instantly share code, notes, and snippets.

@mine-cetinkaya-rundel
Last active December 29, 2022 13:21
Show Gist options
  • Save mine-cetinkaya-rundel/03d7516dea1e5f2613a5d71c28edb08d to your computer and use it in GitHub Desktop.
Save mine-cetinkaya-rundel/03d7516dea1e5f2613a5d71c28edb08d to your computer and use it in GitHub Desktop.
library(tidyverse)
library(rtweet)
library(glue)
tml <- get_timelines("CostcoRiceBag", n = 3200)
br <- tml %>%
filter(is.na(reply_to_screen_name)) %>%
slice(
which(str_detect(text, "IS IT JUST ME")):
max(which(str_detect(text, "[bB]lows")))
) %>%
mutate(first_word = word(text, 1)) # updated to use stringr::word
glue_collapse(br$first_word, sep = " ")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment