library(openintro)
data(loan50)
head(loan50)
summary(loan50)
hist(loan50$emp_length)
attach(loan50)
hist(emp_length)
str(loan50)
attach(loan50)
hist_data <- hist(interest_rate, breaks = 15, col = terrain.colors(15), prob = 2)
if(!require(ggplot2)){
install.packages("ggplot2")
library(ggplot2)}
ggplot(loan50) +
geom_histogram(aes(x = interest_rate, fill = verified_income), binwidth = 5)
ggplot(loan50) +
geom_histogram(aes(x = interest_rate, fill = verified_income), binwidth = 5) +
facet_wrap(~verified_income, nc=1)
boxplot(interest_rate)
boxplot(interest_rate~verified_income)
ggplot(loan50, aes(x=verified_income, y = interest_rate, fill= verified_income))+
geom_boxplot()