Description Usage Arguments Value Author(s) Examples
This function is to compare groups using barplots at each time point. In addition, line segments are used to connect the mean/median of each barplot of the same group across time to show the differences between the mean trajectories. Also, for each barplot the barplot of mean +/- standard error will be plot.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | barPlot(
data,
x = NULL,
y,
group = NULL,
semFlag = TRUE,
xFlag = FALSE,
bar.width = 0.5,
dodge.width = 0.8,
jitter = FALSE,
jitter.alpha = 0.7,
jitter.width = 0.1,
line = NULL,
line.color = "black",
xlab = x,
ylab = line,
theme_classic = TRUE,
group.lab = group,
title = "bar plots",
xLevel = NULL,
addThemeFlag = TRUE,
...)
|
data |
A data frame. Rows are subjects; Columns are variables describing the subjects. |
x |
character. The column name of |
y |
character. The column name of |
group |
character. The column name of |
semFlag |
logical. Indicate if sem or se should be used to draw error bar |
xFlag |
logical. Indicate if |
bar.width |
numeric. error bar width |
dodge.width |
numeric. dodge width for error bar and jitter (prevent overlapping) |
jitter |
logical, plot jitter or not, default TRUE |
jitter.alpha |
numeric. jitter transparency |
jitter.width |
numeric. jitter width in error bar |
line |
character. line connect error bar, default uses mean, can be set as 'median', NULL (no line) |
line.color |
character. connection line color, only available when group = NULL |
xlab |
character. x axis label |
ylab |
character. y axis label |
theme_classic |
logical. Use classic background without grids (default: TRUE). |
group.lab |
character. label of group variable |
title |
character. title of plot |
xLevel |
character. A character vector indicating the order of the elements of |
addThemeFlag |
logical. Indicates if light blue background and white grid should be added to the figure. |
... |
other input parameters for facet & theme |
A list of the following 9 elements: “data”, “layers”, “scales”, “mapping”, “theme”, “coordinates”, “facet”, “plot_env”, “labels”.
Wenfei Zhang <Wenfei.Zhang@sanofi.com>, Weiliang Qiu <Weiliang.Qiu@sanofi.com>, Xuan Lin <Xuan.Lin@sanofi.com>, Donghui Zhang <Donghui.Zhang@sanofi.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | data(longDat)
print(dim(longDat))
print(longDat[1:3,])
print(table(longDat$time, useNA = "ifany"))
print(table(longDat$grp, useNA = "ifany"))
print(table(longDat$sid, useNA = "ifany"))
print(table(longDat$time, longDat$grp))
statVisual(type = 'barPlot',
data = longDat,
x = 'time',
y = 'y',
group = 'grp',
title = "Bar plots across time")
barPlot(
data = longDat,
x = 'time',
y = 'y',
group = 'grp',
title = "Bar plots across time")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.