Load Table 18 from Section 2.3 into R.
Table18 <- read.csv("https://sullystats.github.io/Statistics6e/Data/Chapter2/Table18.csv")
head(Table18,n=5)
## Year PCI
## 1 2005 73.49
## 2 2006 80.16
## 3 2007 88.88
## 4 2008 93.00
## 5 2009 90.54
We will use the ggplot2 package.
install.packages("ggplot2")
The basic syntax of the ggplot function is
ggplot(*data/_file, aes(x = time variable, y = y variable*)) + geom_line + ggtitle(“enter your title here”)
library(ggplot2)
ggplot(Table18, aes(x=Year,y=PCI)) + geom_line() + ggtitle("Partisan Conflict Interest in the United States Federal Government")