## install packages
library(tidyverse)
d.color <- diamonds %>%
filter(color == "D") %>%
select(carat)
j.color <- diamonds %>%
filter(color == "J") %>%
select(carat)
## 2 - sided test
## Alternative hypothesis: x != y
t.test(x = d.color, y = j.color, alternative = "two.sided")
## Alternative hypothesis: x < y by 0.1
t.test(x = d.color, y = j.color, alternative = "less", mu = .1)