--------------------------------
movie<-read.csv("Movie-Ratings.csv")
colnames(movie)<-c("Film","Genre","CriRating",
"AudRatining","BMill","Year")
movie$Year<-factor(movie$Year)
head(movie)
summary(movie)
library(ggplot2)
r<- ggplot(data=movie,
aes(x=CriRating,y=AudRatining,color=Genre))
r
r + geom_point()
r + geom_point()+ geom_smooth()
r + geom_point()+ geom_smooth(fill=NA)
#boxplot
r<- ggplot(data=movie,
aes(x=Genre,y=AudRatining,color=Genre))
r + geom_boxplot()
r + geom_boxplot(size = 1.2)
r + geom_boxplot(size = 1.2) +
geom_point()
r + geom_boxplot(size = 1.2) +
geom_jitter()
#facets
r<- ggplot(data=movie,
aes(x=BMill))
r +geom_histogram(binwidth = 10,
aes(fill=Genre),
color="Black")
r +geom_histogram(binwidth = 10,
aes(fill=Genre),
color="Black")+
facet_grid(Genre~.)
r +geom_histogram(binwidth = 10,
aes(fill=Genre),
color="Black")+
facet_grid(Genre~.,scale="free")
###
z<- ggplot(data=movie,
aes(x=CriRating,y=AudRatining,color=Genre))
z+geom_point(size=1)+
facet_grid(Genre~.)
z+geom_point(size=1)+
facet_grid(.~Year)
z+geom_point(size=1)+
facet_grid(Genre~Year)
z+geom_point(size=1)+
geom_smooth()+
facet_grid(Genre~Year)
z+geom_point(aes(size=BMill))+
geom_smooth()+
facet_grid(Genre~Year)
movie<-read.csv("Movie-Ratings.csv")
colnames(movie)<-c("Film","Genre","CriRating",
"AudRatining","BMill","Year")
movie$Year<-factor(movie$Year)
head(movie)
summary(movie)
library(ggplot2)
r<- ggplot(data=movie,
aes(x=CriRating,y=AudRatining,color=Genre))
r
r + geom_point()
r + geom_point()+ geom_smooth()
r + geom_point()+ geom_smooth(fill=NA)
#boxplot
r<- ggplot(data=movie,
aes(x=Genre,y=AudRatining,color=Genre))
r + geom_boxplot()
r + geom_boxplot(size = 1.2)
r + geom_boxplot(size = 1.2) +
geom_point()
r + geom_boxplot(size = 1.2) +
geom_jitter()
#facets
r<- ggplot(data=movie,
aes(x=BMill))
r +geom_histogram(binwidth = 10,
aes(fill=Genre),
color="Black")
r +geom_histogram(binwidth = 10,
aes(fill=Genre),
color="Black")+
facet_grid(Genre~.)
r +geom_histogram(binwidth = 10,
aes(fill=Genre),
color="Black")+
facet_grid(Genre~.,scale="free")
###
z<- ggplot(data=movie,
aes(x=CriRating,y=AudRatining,color=Genre))
z+geom_point(size=1)+
facet_grid(Genre~.)
z+geom_point(size=1)+
facet_grid(.~Year)
z+geom_point(size=1)+
facet_grid(Genre~Year)
z+geom_point(size=1)+
geom_smooth()+
facet_grid(Genre~Year)
z+geom_point(aes(size=BMill))+
geom_smooth()+
facet_grid(Genre~Year)
No comments:
Post a Comment