plot.Dataset {rpact} | R Documentation |
Dataset Plotting
Description
Plots a dataset.
Usage
## S3 method for class 'Dataset'
plot(
x,
y,
...,
main = "Dataset",
xlab = "Stage",
ylab = NA_character_,
legendTitle = "Group",
palette = "Set1",
showSource = FALSE,
plotSettings = NULL
)
Arguments
x |
The |
y |
Not available for this kind of plot (is only defined to be compatible to the generic plot function). |
... |
Optional plot arguments. At the moment |
main |
The main title, default is |
xlab |
The x-axis label, default is |
ylab |
The y-axis label. |
legendTitle |
The legend title, default is |
palette |
The palette, default is |
showSource |
Logical. If
Note: no plot object will be returned if |
plotSettings |
An object of class |
Details
Generic function to plot all kinds of datasets.
Value
Returns a ggplot2
object.
Examples
# Plot a dataset of means
dataExample <- getDataset(
n1 = c(22, 11, 22, 11),
n2 = c(22, 13, 22, 13),
means1 = c(1, 1.1, 1, 1),
means2 = c(1.4, 1.5, 3, 2.5),
stDevs1 = c(1, 2, 2, 1.3),
stDevs2 = c(1, 2, 2, 1.3)
)
## Not run:
if (require(ggplot2)) plot(dataExample, main = "Comparison of Means")
## End(Not run)
# Plot a dataset of rates
dataExample <- getDataset(
n1 = c(8, 10, 9, 11),
n2 = c(11, 13, 12, 13),
events1 = c(3, 5, 5, 6),
events2 = c(8, 10, 12, 12)
)
## Not run:
if (require(ggplot2)) plot(dataExample, main = "Comparison of Rates")
## End(Not run)