View source: R/twoway.barplot.R
twoway.barplot | R Documentation |
The function could be used as drawing two-way barplot and adding letters representing significant difference automatically. Same uppercase and lowercase denote non-significant difference between factor levels (x axis) for each of group levels and between group levels (group) for each of factor levels (x axis).
twoway.barplot(dat, x.factor = "x.factor", response = "response", group = "group", method = 'HSD.test',maximum=NULL, minmum=NULL, legend=TRUE, sig.letters=NULL, legend.pos='topright',group.name=group,italic.on=FALSE, ...)
dat |
a dataframe.
x.factor |
a category variable at the x axis.
response |
a contineous response variable.
group |
a group variable at the y axis.
method |
one of multiple contrast approach in HSD.test
, duncan.test
, LSD.test
etc in agricolae package. The default is Tukey HSD.test.
maximum |
a parameter which modifies the positions of letters denote significance among groups in figure.
minmum |
a parameter which modifies the lowest y range.
legend |
default is TRUE, legend can be canceled by argument legend=FALSE
sig.letters |
a matrix on letters denoting different significance between level and treatment
legend.pos |
a legend
position.
group.name |
a group name on legend text.
italic.on |
a switch to control whether italic font for group.level in legend.
... |
further arguments pass to bargraph.CI
function.
data(leaflife, package = 'smatr')
twoway.barplot(dat=leaflife,x.factor='rain',group='soilp',response='lma')
twoway.barplot(dat=leaflife,x.factor='rain',group='soilp',response='lma',xlab='Rainfall', ylab=~LMA~(kg~m^-2))
twoway.barplot(dat=leaflife,x.factor='rain',group='soilp',response='lma',xlab='Rainfall', ylab=~LMA~(kg~m^-2),italic.on=TRUE)
twoway.barplot(dat=leaflife,x.factor='rain',group='soilp',response='lma',group.name='Soil P',
xlab='Rainfall', ylab=~LMA~(kg~m^-2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.