data-raw/yates.missing.R

# The yates.missing data already exists, but I am splitting the
# treatments into individual factors

libs(dplyr,stringr)
dat <- yates.missing
dat$trt = casefold(dat$trt)

dat <- mutate(dat,
              n=ifelse(str_detect(trt, "n"), "0", "1"),
              p=ifelse(str_detect(trt, "p"), "0", "1"),
              k=ifelse(str_detect(trt, "k"), "0", "1"))
head(dat)
str(dat)

write.table(dat,
            file = "c:/drop/rpack/agridat/data/yates.missing.txt", 
            sep = "\t", row.names = FALSE)
kwstat/agridat documentation built on Nov. 2, 2024, 6:19 a.m.