Description Usage Arguments Value See Also Examples
View source: R/make_envelope_graph.R
This method builds a ggplot object with the trendline and prediction envelope. It can be customized after the fact by adding more ggplot layers via normal ggplot "+" syntax.
1 | make_envelope_graph(envelope, t0, ylab = "Y", xlab = "month")
|
envelope |
The result of a 'process_outcome_model()' call, i.e. dataframe with columns of original data, imputed data and, potentially, smoothed data. |
t0 |
Last pre-policy timepoint. Will draw vertical line here. |
ylab |
Y label of plot |
xlab |
X label of plot |
Returns (does not yet display) a ggplot plot object containing the time series along with extrapolation and prediction envelope. This plot can be augmented and changed via standard ggplot commands.
The ggplot2
package.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | data( "mecklenberg" )
t0 = 0
envelope = process_outcome_model( "pbail", mecklenberg,
t0=t0, R = 10,
summarize = TRUE, smooth=FALSE )
make_envelope_graph(envelope, t0=t0, ylab = "Proportion given bail") +
ggplot2::labs( title="Sample ITS plot")
data( "mecklenberg" )
t0 = 0
envelope = process_outcome_model( "pbail", mecklenberg,
t0=t0, R = 10,
summarize = TRUE, smooth=FALSE )
make_envelope_graph(envelope, t0=t0, ylab = "Proportion given bail") +
ggplot2::labs( title="Sample ITS plot")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.