-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
44 lines (33 loc) · 1.2 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, options, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
# lebron-tweets
<!-- badges: start -->
<!-- badges: end -->
This repository collects twitter data and stores it to my own personal s3 bucket. More specifically, it...
* Uses `rtweet` to search for tweets with _"lebron"_ in the text.
* Compares new tweets to tweets that I have already collected by filtering out status IDs that already exist.
* Saves the dataset to a personal s3 bucket.
* Does this daily using a cron job from `cronR`.
I have no real use case for this at the moment. I am more or less just interested in setting up a job to collect data. I think of it as a kind of template that I may come back to if there is any twitter data I'd like to routinely collect.
```{r, example, warning=FALSE, message=FALSE}
library(dplyr)
library(aws.s3)
library(stringr)
library(tidyr)
library(emo)
df <- s3readRDS("lebron_tweets.rds", "tylerlittlefield")
df %>%
distinct(text) %>%
mutate(emojis = ji_extract_all(text)) %>%
unnest_longer(emojis) %>%
drop_na(emojis) %>%
count(emojis, sort = TRUE)
```