setwd("/Users/subasishdas1/Desktop/twt/Final")
BR_tweets <- read.csv("BR_TrafficALL_April24_trun.csv" )
BR_tweets1 <- BR_tweets[-c(6,8)]
NOLA_tweets <- read.csv("NOLA_TrafficALL_April24trun.csv")
NOLA_tweets1 <- NOLA_tweets[-c(6,8)]

Sample BR_Tweets

library(formattable)
as.htmlwidget(formattable(BR_tweets1))

Sample NOLA_Tweets

library(formattable)
as.htmlwidget(formattable(NOLA_tweets1))

Most frequent terms

library(ggplot2)
setwd("/Users/subasishdas1/Desktop/twt/Final")
tdm_BR <- read.csv("BR_Month_sparse.csv")
as.htmlwidget(formattable(tdm_BR))

tdm_BR_1 <- tdm_BR[c(1,14 )]
p <- ggplot(tdm_BR_1, aes(x = reorder(Term, -Count), y = Count))
p <- p + geom_bar(stat = "identity")+theme_bw()+ theme(axis.title.x = element_blank())+ggtitle("BR_Traffic")
p <- p + theme(axis.text.x=element_text(angle=45, hjust=1))
p 

tdm_NOLA <- read.csv("NOLA_Month_sparse.csv")
tdm_NOLA <- tdm_NOLA[-c(15)]
as.htmlwidget(formattable(tdm_NOLA))

tdm_NOLA_1 <- tdm_NOLA[c(1,14 )]
p <- ggplot(tdm_NOLA_1, aes(x = reorder(Term, -Count), y = Count))
p <- p + geom_bar(stat = "identity")+theme_bw()+ theme(axis.title.x = element_blank())+ggtitle("NOLA_Traffic")
p <- p + theme(axis.text.x=element_text(angle=45, hjust=1))
p 

Heatmap of BR_Tweets

library(ggplot2)
setwd("/Users/subasishdas1/Desktop/twt/Final")
tdm_BT_2= read.csv("tdm_BR_heatmap.csv")
tdmm <- subset(tdm_BT_2, value>100)
head(tdmm)
##           Term month_cat value month_num
## 6      blocked       Apr   133         4
## 14  congestion       Apr   266         4
## 25  lane/lanes       Apr   247         4
## 32 open/opened       Apr   118         4
## 59     blocked       Aug   168         8
## 61      bridge       Aug   112         8
radius <-tdmm$value
length(radius)
## [1] 58
library(ggplot2)
ggplot(tdmm,aes(x=Term,y=reorder(month_cat, month_num)))+
  geom_point(aes(size=radius),shape=21,fill="white")+
  geom_text(aes(label=value),size=4)+ theme(axis.title.y = element_blank())

  scale_size_identity()+
  theme(panel.grid.major=element_line(linetype=2,color="black"),
        axis.text.x=element_text(angle=90,hjust=1,vjust=0))
## NULL
ggplot(tdm_BT_2, aes(x= reorder(month_cat, month_num), Term, fill = value)) +
geom_tile(colour = "white") +
scale_fill_gradient(high="#FF0000" , low="#FFFFFF")+
ylab("")+ xlab("Month")+
theme(panel.background = element_blank()) +
theme(axis.ticks.x = element_blank())+ theme(axis.text.y = element_text(size = 6))

Conducted by: Subasish Das