Directions

During ANLY 512 we will be studying the theory and practice of data visualization. We will be using R and the packages within R to assemble data and construct many different types of visualizations. We begin by studying some of the theoretical aspects of visualization. To do that we must appreciate the actual steps in the process of making a visualization.

Most of us use softare to do this and have done so for so long that we have lost an appreciation for the mechanistic steps involved in accurately graphing data. We will fix that this week by creating a series of analog (meaning you draw them by hand) graphics. The visualizations you create must be numerically and visually accurate and precisely scaled. Because of that the data sets we visualize will be small.

The final product of your homework (this file) should include scanned or photographed images for each question below and a short summary of the process.

To submit this homework you will create the document in Rstudio, using the knitr package (button included in Rstudio) and then submit the document to your Rpubs account. Once uploaded your will submit the link to that document on Moodle.

Import Library

library(ggplot2)
## Warning: package 'ggplot2' was built under R version 3.2.5
library(ggthemes)

Vis1

Vis1<-ggplot(mpg,aes(class))
Vis1 + geom_bar(aes(fill = trans)) + labs(fill="Transmission")

Vis2

Vis2<-ggplot(mpg,aes(manufacturer,hwy))
Vis2 + geom_boxplot()+ coord_flip() + labs(x="Vehicle Manufacturer", y="Highway Fuel Efficiency (miles/gallon)") + theme_classic()

Vis3

Vis3<-ggplot(diamonds,aes(price,color=cut))
Vis3 + geom_density(aes(fill=cut),alpha=0.3) +theme_economist() +labs(title="Diamond Price Density", x="Diamond Price(USD)",y="Density")

Vis4

Vis4<-ggplot(iris,aes(Sepal.Length,Petal.Length))
Vis4 + geom_point(position="jitter") +  geom_smooth(method="lm") +  labs(title="Relationship between Petal and Sepal Length", x="Iris Septal Length", y="Iris Petal Length") +  theme_minimal()

Vis5

Vis5<-ggplot(iris,aes(Sepal.Length,Petal.Length,color=Species))
Vis5 +  geom_point() +  geom_smooth(method="lm",se=F) +  labs(title="Relationship between Petal and Sepal Length", x="Iris Septal Length", y="Iris Petal Length") +  theme_tufte() +  theme(legend.position="bottom")