1. Importing Data into R

Install the ISLR package, load the tidyverse and ISLR package and Wage data.

library(ISLR)
library(tidyverse)

data(Wage)
  1. Produce a scatterplot with wage on the y-axis and age on the x-axis, fill and color the points using education levels

  2. Load the Census Term 1 File, install the Hmisc package and create a new variable called “ACT_GROUP” with the following commands.

library(Hmisc)

census_term1 <- read_csv("https://raw.githubusercontent.com/bpattizUCM/MidAIR2017/master/Census%20Term1.csv") %>%
filter(!is.na(ACT)) %>%
mutate(ACT_GROUP = cut2(ACT, g = 4))

head(census_term1 %>% select(ID, ACT, ACT_GROUP))

Create a boxplot of HS_GPA and ACT_GROUP. Fill by ACT_GROUP, change the x-axis label to “ACT” and the y-axis to “High School GPA”give it a title called “High School GPA by ACT”. Center the title using the followign command: theme(plot.title = element_text(hjust = 0.5))

  1. Create a faceted histogram of Hours by Stype. Use a binwidth of 0.95 for the histogram.

  2. Create a bar plot of 1995 Enrollment with your University/College with two peer institutions. Run the following code to get the data and use row.names(College) to find the peer instituions.

data(College)

College_DF <-
  College %>%
  rownames_to_column("College") %>%
  select(College, Enroll)

Change the y-axis label to “Enrollment”. Give it the black and white theme. Create a caption to give credit to the US News and World Report.