Here, I imported the cars data. I named the data set “cars”.

wd<-getwd()
cars<-read.csv("cars_data.csv")

Here, I got the column names.

colnames(cars)
##  [1] "X"    "mpg"  "cyl"  "disp" "hp"   "drat" "wt"   "qsec" "vs"   "am"  
## [11] "gear" "carb"
  1. What is the average (mean()) mpg for all cars?
mean(cars$mpg)
## [1] 20.09062
  1. What is the minimum mpg for all cars?
min(cars$mpg)
## [1] 10.4
  1. What is the maximum mpg for all cars?
max(cars$mpg)
## [1] 33.9
  1. How many cars are there in the dataset? (Hint: length() of mpg)
length(cars$mpg)
## [1] 32