library(datasets) summary(mtcars) str(mtcars)
cor(mtcars) round(cor(mtcars), 2)
cormatrix <- cor(mtcars)
install.packages(“corrplot”) library(corrplot) ?corrplot corrplot(cormatrix) ##########################################
hist(mtcars$hp)
boxplot(mtcars\(mpg) # to find outlier boxplot(mtcars\)mpg)$out
plot(mtcars\(hp, mtcars\)mpg) # both point and line chart ?plot plot(mtcars\(hp, mtcars\)mpg, “b”) plot(mtcars\(hp, mtcars\)mpg, “l”)
table(mtcars\(cyl) barplot(table(mtcars\)cyl)) barplot(sort((table(mtcars\(cyl)),col = "red")) barplot((table(mtcars\)cyl)),col = “red”) ######################################################