library(twowaytests)
data(alveolar)
# to obtain error bar (mean +- standard deviation)
gplotTwoWay(cell ~ ovalbumin*treatment, data = alveolar, type = "errorbar", option = "sd")
# to change factor places in graph
gplotTwoWay(cell ~ treatment*ovalbumin, data = alveolar, type = "errorbar", option = "sd")
# to obtain error bar (mean +- standard error)
gplotTwoWay(cell ~ ovalbumin*treatment, data = alveolar, type = "errorbar", option = "se")
# to draw interaction plot with mean
gplotTwoWay(cell ~ ovalbumin*treatment, data = alveolar, type = "interaction", metric = "mean")
# to draw interaction plot with median
gplotTwoWay(cell ~ ovalbumin*treatment, data = alveolar, type = "interaction", metric = "median")
# to obtain box-and-whisker plot
gplotTwoWay(cell ~ ovalbumin*treatment, data = alveolar, type = "boxplot")
# to obtain violin plot
gplotTwoWay(cell ~ ovalbumin*treatment, data = alveolar, type = "violin")
# to define specific colors
gplotTwoWay(cell ~ ovalbumin*treatment, data = alveolar, type = "errorbar", option = "sd",
color_manual = c("#999999", "#E69F00", "#56B4E9"))
# to change color palette
library(wesanderson)
gplotTwoWay(cell ~ ovalbumin*treatment, data = alveolar, type = "errorbar", option = "sd",
color_manual = wes_palette(name = "GrandBudapest1", n = 3))
Run the code above in your browser using DataLab