# ferdo R Lab | Lesson 6 | Setup check
stopifnot(file.exists("data/class_synthetic.csv"))
d <- read.csv("data/class_synthetic.csv",na.strings=c("","NA"),
              stringsAsFactors=FALSE)
d$group <- factor(d$group,levels=c("A","B"))
paired <- complete.cases(d[,c("study_hours","quiz_score")])
stopifnot(identical(dim(d),c(12L,4L)),
          length(unique(d$student_id))==12L,
          identical(as.integer(table(d$group)),c(6L,6L)),
          sum(is.na(d$quiz_score))==1L,
          sum(is.na(d$study_hours))==1L,
          sum(paired)==10L)
cat("R LAB LESSON 6 SETUP CHECK PASS\n")
