tidy text r def text structure code example

Example 1: tidytext extract url r

library(tidyverse)
library(tidytext)
library(lubridate)
library(stringr)
library(httr)

google_sheet_csv <- '' #insert URL of published CSV file from TAGS archive Google sheet
tweets <- read_csv(google_sheet_csv,
                   col_types = 'ccccccccccccciiccc') %>%
  mutate(date = mdy(paste(substring(created_at, 5, 10), substring(created_at, 27 ,30))))

source_text <- '#americafirst'
minimum_occurrences <- 5 # minimum number of occurrences to include in output

Example 2: tidytext extract url r

sources <- tweets %>%
  group_by(source) %>%
  count() %>%
  arrange(-n)

Tags:

R Example