LinePlot {statVisual} | R Documentation |
Compare Groups Based on Trajectory Plots
Description
Compare groups based on trajectory plots. Trajectories belonging to different groups will have different colors.
Usage
LinePlot(
data,
x,
y,
sid,
group = NULL,
xFlag = FALSE,
points = TRUE,
point.size = 1,
theme_classic = TRUE,
xlab = x,
ylab = y,
title = "Trajectory plot",
xLevel = NULL,
addThemeFlag = TRUE,
...)
Arguments
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 |
sid |
character. The column name of |
group |
character. The column name of |
xFlag |
logical. Indicate if |
points |
logical. Indicates if points will be added to the trajectories on the coordinate (x, y). |
point.size |
numeric. size of the data points on the trajectories |
theme_classic |
logical. Use classic background without grids (default: TRUE). |
xlab |
character. x axis label |
ylab |
character. y axis label |
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 |
Value
A list with the following 9 elements: data
, layers
, scales
, mapping
, theme
, coordinates
, facet
,
plot_env
, and labels
.
Author(s)
Wenfei Zhang <Wenfei.Zhang@sanofi.com>, Weiliang Qiu <Weiliang.Qiu@sanofi.com>, Xuan Lin <Xuan.Lin@sanofi.com>, Donghui Zhang <Donghui.Zhang@sanofi.com>
Examples
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 = "LinePlot",
data = longDat,
x = 'time',
y = 'y',
sid = 'sid',
group = 'grp')
LinePlot(
data = longDat,
x = 'time',
y = 'y',
sid = 'sid',
group = 'grp')