----------------
movie<-read.csv("movie.csv")
head(movie)
summary(movie)
str(movie)
library(ggplot2)
ggplot(data=movie,aes(x=Day.of.Week))+
geom_bar()
# filtering data frame
filter1<-(movie$Genre=="action")|(movie$Genre=="adventure")|
(movie$Genre=="animation")|(movie$Genre=="comedy")|
(movie$Genre=="drama")
filter1
filter2<-movie$Studio %in% c("Buena Vista Studios","WB","Fox","Universal","Sony","Paramount Pictures")
filter2
movie2<-movie[filter1 & filter2,]
movie2
tail(movie2)
vlr<-ggplot(data=movie2,aes(x=Genre,y=Gross...US))
vlr + geom_jitter()+
geom_boxplot()
#use alpah
vlr + geom_jitter()+
geom_boxplot(alpha=.7)
# use color and size
vlr + geom_jitter(aes(size=Budget...mill.,
color=Studio))+
geom_boxplot(alpha=0.7)
# change block dots
vlr + geom_jitter(aes(size=Budget...mill.,
color=Studio))+
geom_boxplot(alpha=0.7,outlier.colour = NA)
vlr1<- vlr + geom_jitter(aes(size=Budget...mill.,
color=Studio))+
geom_boxplot(alpha=0.5,outlier.colour = NA)
vlr1
vlr1 +
xlab("Genre")+
ylab("Gross % Us")+
ggtitle("Domestic Gross % by Genre")+
theme(
axis.title.x = element_text(color="Blue",size=10),
axis.title.y = element_text(color="Blue",size=10),
axis.text.y = element_text(size=10),
axis.text.x = element_text(size=10),
plot.title = element_text(size=20),
legend.title = element_text(size=20),
legend.text = element_text(size=20),
)
movie<-read.csv("movie.csv")
head(movie)
summary(movie)
str(movie)
library(ggplot2)
ggplot(data=movie,aes(x=Day.of.Week))+
geom_bar()
# filtering data frame
filter1<-(movie$Genre=="action")|(movie$Genre=="adventure")|
(movie$Genre=="animation")|(movie$Genre=="comedy")|
(movie$Genre=="drama")
filter1
filter2<-movie$Studio %in% c("Buena Vista Studios","WB","Fox","Universal","Sony","Paramount Pictures")
filter2
movie2<-movie[filter1 & filter2,]
movie2
tail(movie2)
vlr<-ggplot(data=movie2,aes(x=Genre,y=Gross...US))
vlr + geom_jitter()+
geom_boxplot()
#use alpah
vlr + geom_jitter()+
geom_boxplot(alpha=.7)
# use color and size
vlr + geom_jitter(aes(size=Budget...mill.,
color=Studio))+
geom_boxplot(alpha=0.7)
# change block dots
vlr + geom_jitter(aes(size=Budget...mill.,
color=Studio))+
geom_boxplot(alpha=0.7,outlier.colour = NA)
vlr1<- vlr + geom_jitter(aes(size=Budget...mill.,
color=Studio))+
geom_boxplot(alpha=0.5,outlier.colour = NA)
vlr1
vlr1 +
xlab("Genre")+
ylab("Gross % Us")+
ggtitle("Domestic Gross % by Genre")+
theme(
axis.title.x = element_text(color="Blue",size=10),
axis.title.y = element_text(color="Blue",size=10),
axis.text.y = element_text(size=10),
axis.text.x = element_text(size=10),
plot.title = element_text(size=20),
legend.title = element_text(size=20),
legend.text = element_text(size=20),
)
thank u
ReplyDelete