ez.lineplot | R Documentation |
line plot with ggplot
ez.lineplot(
df,
cmd,
colors = ez.palette("Zhu"),
line.size = 0.7,
error.size = 0.7,
error.gap = 0,
error.width = 0.3,
error.direction = "both",
ylab = NULL,
xlab = NULL,
zlab = NULL,
legend.position = "top",
legend.direction = "horizontal",
legend.box = T,
legend.size = c(0, 10),
xangle = 0,
vjust = NULL,
hjust = NULL,
theme.apa = TRUE
)
df |
data frame in long format (but be careful that standard error might be inaccurate depending on grouping in the long format)
|
cmd |
like "y|x, y|x z, y|x z a" where y (axis) is continous, x (axis) z/a (legend) are discrete, during plot x z a ->x z(za combined) |
line.size |
the thickness of line, only applicable when there is z provided |
error.size |
the thickness of error bar line |
error.gap |
the location of errorbar, should not be adjusted, 0 (parameter kept for reference) |
error.width |
the width of the bar of error |
error.direction |
'both', 'max', 'min' |
ylab |
y label NULL |
xlab |
x label NULL |
zlab |
z/a/fill/legend label, only applicable when there is z provided NULL |
legend.position |
legend position 'top', 'bottom', 'left', 'right', 'none', c(x,y,two-element numeric vector)
|
legend.direction |
horizontal or vertical |
legend.box |
box of legend, T or F |
legend.size |
c(0,10) the first number 0 controls the legend title, 0=hide; the second number controls legend.key.size, legend.text |
xangle |
angle of x text 0 |
vjust |
vjust of x text NULL |
hjust |
hjust of x text NULL |
a ggplot object (+theme_apa() to get apa format plot) , +scale_y_continuous(limits=c(-5,8),breaks=seq(-5,8,by=2),oob=scales::rescale_none)
see http://stackoverflow.com/a/31437048/2292993 for discussion
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.