Skip to content

Instantly share code, notes, and snippets.

Avatar

Natalie Chuyakova Chuyakova

View GitHub Profile
@Chuyakova
Chuyakova / newPublicGistFile.txt
Created Nov 15, 2019
This is description for public gist
View newPublicGistFile.txt
The content is here
@Chuyakova
Chuyakova / twitter_sentiment.R
Created Nov 15, 2019 — forked from geroldcsendes/twitter_sentiment.R
Get twitter data, clean & analyze it
View twitter_sentiment.R
# Get twitter data
trainer <- search_tweets(q = "Guardiola", n=18000, type='mixed', lang="en")
# Assign relevant columns
keep_cols <- c("user_id", "screen_name", "created_at", "text", "source", "is_quote","is_retweet", "favorite_count", "retweet_count","quote_count","reply_count","hashtags","retweet_text", "followers_count", "verified")
# Filter to relevant columns
trainer <- trainer %>%
select(keep_cols)
# Source for URL removal: https://www.earthdatascience.org/courses/earth-analytics/get-data-using-apis/text-mining-twitter-data-intro-r/
trainer$stripped_text <- gsub("http.*","", trainer$text) # Remove http
trainer$stripped_text <- gsub("https.*","", trainer$stripped_text) # Remove https
@Chuyakova
Chuyakova / newPublicGistFile.txt
Created Nov 15, 2019
This is description for public gist
View newPublicGistFile.txt
The content is here
@Chuyakova
Chuyakova / newPublicGistFile.txt
Created Nov 15, 2019
This is description for public gist
View newPublicGistFile.txt
The content is here
@Chuyakova
Chuyakova / newPublicGistFile.txt
Created Nov 15, 2019
This is description for public gist
View newPublicGistFile.txt
The content is here
@Chuyakova
Chuyakova / newPublicGistFile.txt
Created Nov 15, 2019
This is description for public gist
View newPublicGistFile.txt
The content is here
View plotting
library(fmsb)
df <- read_csv("imdb_top_250_sentiments.csv", col_types = c(col_character(),
col_character(),
col_double(),
col_double(),
col_character(),
col_character()))
counts <- as.data.frame(table(df$Overall_sentiment))
@Chuyakova
Chuyakova / newPublicGistFile.txt
Created Nov 15, 2019
This is description for public gist
View newPublicGistFile.txt
The content is here
@Chuyakova
Chuyakova / newPublicGistFile.txt
Created Nov 15, 2019
This is description for public gist
View newPublicGistFile.txt
The content is here
@Chuyakova
Chuyakova / newPublicGistFile.txt
Created Nov 14, 2019
This is description for public gist
View newPublicGistFile.txt
The content is here
You can’t perform that action at this time.