Description Usage Arguments Details Examples
View source: R/LineChart-functions.R
This function uses a data frame with the same format as one created by createPlottingDf. This is mainly an internal function that is called by lineChart, but it can be called directly if more control of plotDf is desired.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
plotDf |
The data frame to plotted. |
title |
The title to place at the top of the plot. |
xlab |
The label to place on the x-axis. If NULL (default), the name of the source of data for the x-variable will be used, if available. |
ylab |
The label to place on the y-axis. If NULL (default), the name of the source of data for the y-variable will be used if available. |
ylim |
The plotting range of the y-axis. |
xlim |
The plotting range of the x-axis. |
plotXAxis |
Should the x-axis be plotted? |
plotYAxis |
Should the y-axis be plotted? |
legendPosition |
The position at which the legend should be placed. If NULL, no legend is plotted. If "CHOOSE_BEST", the best legend position is selected. Otherise, it is passed through to legend() directly. |
legendTitle |
The title to be used in the legend box. If "GROUP_NAME" (default), the name of the source of data for the grouping variable will be used. If no legend title is desired, use |
lwd.axes |
The line width of the axes and box around the plotting area. |
add |
If FALSE, a new plot will be started and the data plotted in it. If TRUE, the data will be plotted in the current plotting device, if any. |
... |
Additional parameters, currently passed on to the legend creating functions. |
If xlab
and/or ylab
are NULL
, the original names of the source of the data are used for plotting, if available. The original names are stored in attributes and sometimes attributes are lost or, in the case of a manually created plotting data frame, not present. The original names are stored in an attribute called "originalNames" which is a list with "y", "x", and "group" components.
1 2 3 4 5 6 7 8 9 10 11 | data(ChickWeight)
#Use just a subset of the data
ChickWeight = ChickWeight[ ChickWeight$Diet %in% c(1, 3), ]
plotDf = createPlottingDf(weight ~ Time * Diet, ChickWeight, errBarType="SD")
#Make single-sided error bars, using the standard deviation on just one side
plotDf[plotDf$group == 1, ]$ebUpper = 0 # Upper error bar, if ebLower is also provided
plotDf[plotDf$group == 3, ]$ebLower = 0
lineChartDf(plotDf)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.