data(mtcars)
dim(mtcars)
nrow(mtcars)
ncol(mtcars)
names(mtcars)
# Names of cars (row names)
rownames(mtcars)
# Summary of dataset
summary(mtcars)
# 2. Frequency tables
table(cut(mtcars$mpg, breaks=5))
table(cut(mtcars$wt, breaks=5))
table(cut(mtcars$disp, breaks=5))
table(cut(mtcars$hp, breaks=5))
# 3. Mean and Standard Deviation
mean(mtcars$mpg)
sd(mtcars$mpg)
mean(mtcars$wt)
sd(mtcars$wt)
mean(mtcars$disp)
sd(mtcars$disp)
mean(mtcars$hp)
sd(mtcars$hp)
# 4. Variance-Covariance matrix
var(mtcars[,c("mpg","wt","disp","hp")])
