# NOT RUN {
DIR = getwd()
setwd(tempdir())
TG <- ToothGrowth
TG$dose <- as.factor(TG$dose)
# Without interaction
TwoFactors('len','supp','dose',Data=TG, Inter=FALSE)
# With two-way interaction
TwoFactors('len', 'supp', 'dose', Data=TG, Inter=TRUE)
# For unbalanced data
TG_Unb <- TG[-c(53:60),]
TwoFactors('len', 'supp', 'dose', Data=TG_Unb, Inter=TRUE)
rm(TG); rm(TG_Unb)
# N.B. Various files and a folder were created in a temporary directory.
# Please investigate them to see how this function worked.
setwd(DIR)
# }
Run the code above in your browser using DataLab