# MinutePlot validation -- t-tests, paired and one-sample (sleep)
# Install once: nothing -- this script uses base R only

# Versions (compare against those stated on this page):
cat(R.version.string, "\n")

# Load data:
s <- sleep                       # built-in; or: s <- read.csv("sleep_r.csv")  (same folder as script)
g1 <- s$extra[s$group == 1]; g2 <- s$extra[s$group == 2]

# Analysis (one print per table shown on the page, in page order):
print(t.test(g1, mu = 0))                 # one-sample, group 1 against 0
print(t.test(g1, g2, paired = TRUE))      # paired
