Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Data<-data.frame("Date"=as.Date(16200:16499),"Total"=rnorm(300,4500,50))
- Mean<-mean(Data$Total)
- SD1<-Mean-sd(Data$Total)
- SD2<-Mean+sd(Data$Total)
- TotalDay <- ggplot(data = Data, aes(x=Date, y=Total,colour=Legend)) +
- geom_line(aes(y=Total, colour="Total Tweets"))
- TotalDay + ggtitle("Tweets per Day") +labs(x="Date",y="Tweets") +
- theme(plot.title = element_text(color="#666666", face="bold", size=18, hjust=0)) +
- theme(axis.title = element_text(color="#666666", face="bold", size=13)) +
- geom_hline(aes(yintercept =Mean,colour="Mean")) +
- geom_hline(aes(yintercept =(SD1),
- colour="Standard Deviation"))+
- geom_hline(aes(yintercept =(SD2),
- colour="Standard Deviation"))
- TotalDay + scale_color_manual(name="Legend",
- values=c("Total Tweets"="#f04546","Mean"="#3591d1","Standard Deviation"="#62c76b"))
- library(stringr)
- library(dplyr)
- library(Ryacas)
- library(quantmod)
- library(data.table)
- library(tm)
- library(lubridate)
- library(ggplot2)
- library(extrafont)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement