library(ggplot2)
library(plotly)
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
avg_hw <- read.csv('avg_homework.csv')
avg_y <- avg_hw$average[avg_hw$homework == "Y"]
avg_n <- avg_hw$average[avg_hw$homework == "N"]
t.test(avg_y, avg_n, "greater")
## 
##  Welch Two Sample t-test
## 
## data:  avg_y and avg_n
## t = 4.4313, df = 60.812, p-value = 1.99e-05
## alternative hypothesis: true difference in means is greater than 0
## 95 percent confidence interval:
##  0.345929      Inf
## sample estimates:
## mean of x mean of y 
##  3.456522  2.901316
p1 <- ggplot(avg_hw, aes(x=homework, y=average)) + geom_boxplot(fill = 'steelblue')
ggplotly(p1)