Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.Rproj.user
.Rhistory
.RData
13 changes: 13 additions & 0 deletions twitter-data.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX
31 changes: 31 additions & 0 deletions twitter.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: "Twitter"
author: "Zee"
date: "11 October, 2016"
output: html_document
---

```{r}
#Set working directory
setwd("~/Documents/EDM2016/twitter-data")

#Save data as twitter_data
twitter_data <- read.csv("HUDK4050-twitter-10-06-16.csv", header = TRUE, sep = ",")
head(twitter_data)

#Plot favorite counts with respect to time index
plot(twitter_data$favoriteCount)

#Histogram (frequency of tweets with respect to time index)
hist(twitter_data$time, breaks = 100)

#Scatter plot of number of favorite versus time
plot(twitter_data$favoriteCount, twitter_data$time)

#Boxplot tweeting time by screenName
boxplot(twitter_data$time ~ twitter_data$screenName, las = 2)

#Boxplot favoriteCount by ScreeName
boxplot(twitter_data$favoriteCount ~ twitter_data$screenName, las = 2)
```