library(readr)
cars_data <- read_csv("cars_data.csv")
## New names:
## Rows: 32 Columns: 12
## ── Column specification
## ──────────────────────────────────────────────────────── Delimiter: "," chr
## (1): ...1 dbl (11): mpg, cyl, disp, hp, drat, wt, qsec, vs, am, gear, carb
## ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
## Specify the column types or set `show_col_types = FALSE` to quiet this message.
## • `` -> `...1`
#To find the mean, you use the mean() command. You have to tell the system to look at the cars_data file, and then $ and then the column title of the data you want to average.
mean(cars_data$mpg)
## [1] 20.09062
#To find the min, you use the min() command. You have to tell the system to look at the cars_data file, and then $ and then the column title of the data you want to find the min of.
min(cars_data$mpg)
## [1] 10.4
#To find the max, you use the max() command. You have to tell the system to look at the cars_data file, and then $ and then the column title of the data you want to find the max of.
max(cars_data$mpg)
## [1] 33.9
#To find the lenth, you use the length() command. You have to tell the system to look at the cars_data file, and then $ and then the column title of the data you want to find the length of vector, which is the amount of cars.
length(cars_data$...1)
## [1] 32