-----------------------------------------------------
movie<-read.csv("Movie-Ratings.csv")
movie
head(movie)
colnames(movie)
colnames(movie)<-c("Film","Genre","CriRating","AudRatining","BMill","Year")
head(movie)
tail(movie)
str(movie)
summary(movie)
#convert year to factor
factor(movie$Year)
movie$Year<-factor(movie$Year)
head(movie)
summary(movie)
library(ggplot2)
ggplot(data=movie,aes(x=CriRating,y=AudRatining))
ggplot(data=movie,
aes(x=CriRating,y=AudRatining)) +
geom_point()
#add color
ggplot(data=movie,
aes(x=CriRating,y=AudRatining,color=Genre)) +
geom_point()
#size
ggplot(data=movie,
aes(x=CriRating,y=AudRatining,color=Genre,
size=Genre)) +
geom_point()
#size
ggplot(data=movie,
aes(x=CriRating,y=AudRatining,color=Genre,
size=BMill)) +
geom_point()
movie<-read.csv("Movie-Ratings.csv")
movie
head(movie)
colnames(movie)
colnames(movie)<-c("Film","Genre","CriRating","AudRatining","BMill","Year")
head(movie)
tail(movie)
str(movie)
summary(movie)
#convert year to factor
factor(movie$Year)
movie$Year<-factor(movie$Year)
head(movie)
summary(movie)
library(ggplot2)
ggplot(data=movie,aes(x=CriRating,y=AudRatining))
ggplot(data=movie,
aes(x=CriRating,y=AudRatining)) +
geom_point()
#add color
ggplot(data=movie,
aes(x=CriRating,y=AudRatining,color=Genre)) +
geom_point()
#size
ggplot(data=movie,
aes(x=CriRating,y=AudRatining,color=Genre,
size=Genre)) +
geom_point()
#size
ggplot(data=movie,
aes(x=CriRating,y=AudRatining,color=Genre,
size=BMill)) +
geom_point()
In case the file is not CSV extension but .XLS how to import the file in "R".
ReplyDeleteWhy is it always .CSV file that is mentioned in examples??