Data Import and Explanation

data1 <- read.csv(file.choose(), header=T, sep=",")
)

Data Understanding

The Head function displays the first few rows of the dataset

head(data1)

The dim function displays the dimensions of the dataset

dim(data1)

The str function displays the data structure of the dataset

str(data1)

Here I use the summary functions to print out some information about the dataset

summary(data1)

The lines of code below transform am from an integer to boolean

attach(data1)
sapply(data1, class)

data1_mod <- transform(data1, am=as.logical(am))

sapply(data1_mod, class)

Data Visualization

Scatterplot

plot(hp, mpg)

In this scatterplot, we can see a strong negative correlation between mpg and hp. As Horsepower increases, a vehicle gets less miles per gallon.

Bar Chart

barplot(cyl)

Histogram

hist(mpg)