plotDesign | R Documentation |
Provides a graphical representation of the experimental design for up to 4 factors. It allows to visualize factors levels and check the balancing of the design.
plotDesign( design, x = NULL, y = NULL, rows = NULL, cols = NULL, title = "Plot of the design", theme = theme_bw() )
design |
A nxk "free encoded" experimental design data frame. |
x |
By default: the first column of |
y |
By default: the second column of |
rows |
By default: the fourth column of |
cols |
By default: the third column of |
title |
Plot title. |
theme |
ggplot theme, see |
A plot of the design (ggplot).
### mtcars data(mtcars) library(tidyverse) df <- mtcars %>% dplyr::select(cyl, vs, am, gear, carb) %>% as.data.frame() %>% dplyr::mutate(across(everything(), as.factor)) # 2 factors plotDesign(design = df, x = "cyl", y = "vs", cols = NULL, rows = NULL) # 3 factors plotDesign(design = df, x = "cyl", y = "vs", cols = NULL, rows = c("am")) # 4 factors plotDesign(design = df, x = "cyl", y = "vs", cols = c("gear"), rows = c("am")) # 5 factors plotDesign(design = df, x = "cyl", y = "vs", cols = c("gear"), rows = c("am","carb")) plotDesign(design = df, x = "cyl", y = "vs", cols = c("vs"), rows = c("am","carb")) ### UCH data("UCH") plotDesign(design = UCH$design, x = "Hippurate", y = "Citrate", rows = "Day")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.