Description Usage Arguments Details Value Author(s) Examples
Set significant labels of multi comparisons with given data.
1 2 3 4 5 6 7  | 
dt | 
 data.frame. Support data of both long and short format.  | 
col.data | 
 column indices or names for data. If only one column, the data.frame is treated as long format; otherwise the data.frame should be short format.  | 
col.labels | 
 column indices or names for labels.  | 
group.by | 
 column name or index for grouping. If set, siglabs will be set independently for each group.  | 
stat.vals | 
 TRUE/FALSE(default). If FALSE (typically for short format data), return significant labels (vector) only; otherwise, return a data.frame.  | 
1. get t-test p-value table of pairwise compairison; 2. set siglabs with function sigLabsPT.
string vector of significant letter
ZG Zhao
1 2 3 4 5 6 7 8 9 10 11 12  | library("Xtools")
dt <- read.csv(file.path(path.package("Xtools"), "data", "data.measure.csv"))
str(dt)
dx <- sigLabsDT(dt, col.data=4:7, group.by="Plant", stat.vals=TRUE)
dx
library("ggplot2")
px <- ggplot(dx, aes(x=Leaf, y=mean, fill=Treat)) + theme_bw(base_size = 16)
px + geom_bar(stat="identity", position=position_dodge(.9), width=0.8, color="gray20") +
  geom_errorbar(aes(ymin=mean - sd, ymax=mean + sd), position = position_dodge(.9), width=0.5) +
  geom_text(aes(y=mean + sd + offset, label=siglabs), position=position_dodge(.9), size=5) +
  scale_y_continuous(expand = c(0, 0)) + geom_blank(aes(y = (mean + sd) * 1.15)) +
  facet_wrap(~Plant, nrow=1)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.