ggplot.visitation_forecast {VisitorCounts} | R Documentation |
visitation_forecast ggPlot Method
Description
Methods for plotting objects of the class "visitation_forecast".
Usage
## S3 method for class 'visitation_forecast'
ggplot(
data,
mapping = aes(),
difference = FALSE,
log_outputs = FALSE,
actual_visitation = NULL,
xlab = "Time",
ylab = "Fitted Value",
pred_color = "#228B22",
actual_color = "#FF0000",
size = 1.5,
main = "Forecasts for Visitation Model",
plot_points = FALSE,
date_breaks = "1 month",
date_labels = "%y %b",
...
)
Arguments
data |
An object of the "visitation_forecast" class. |
mapping |
Default list of aesthetic mappings to use for plot. If not specified, must be supplied in each layer added to the plot. |
difference |
A boolean to plot the differenced series. |
log_outputs |
A boolean to plot the logged outputs of the forecast. |
actual_visitation |
A timeseries object representing the actual visitation that will be plotted along site the visitation_forecast object. |
xlab |
A string that will be used for the xlabel of the plot. |
ylab |
A string that will be used for the ylabel of the plot. |
pred_color |
a String that will be used for the predicted series color of the plot. |
actual_color |
a String that will be used for the actual series color of the plot. |
size |
A number that represents the thickness of the lines being plotted. |
main |
A string that will be used for the title of the plot. |
plot_points |
a boolean to specify if the plot should be points or continous line. |
date_breaks |
A string to represent the distance between dates that the x-axis should be in. ex "1 month", "1 year". |
date_labels |
A string to represent the format of the x-axis time labels. ex |
... |
extra arguments to pass in |
Value
No return value, called for plotting objects of the class "visitation_forecast".
Examples
#' #Example:
data("park_visitation")
data("flickr_userdays")
n_ahead <- 12
park <- "YELL"
pud_ts <- ts(park_visitation[park_visitation$park == park,]$pud, start = 2005, freq = 12)
pud_ts <- log(pud_ts)
trend_proxy <- log(flickr_userdays)
mf <- visitation_model(pud_ts,trend_proxy)
vf <- predict(mf,12, only_new = TRUE)
plot(vf)