Skip to content

Commit

Permalink
Merge pull request #466 from mitchelloharawild/ggplot_geomForecast2
Browse files Browse the repository at this point in the history
Fixed issue with geom_forecast when using ts object and series argument
  • Loading branch information
robjhyndman committed Jan 10, 2017
2 parents 9e02207 + e475a48 commit b6b1605
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion R/ggplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -1535,7 +1535,12 @@ geom_forecast <- function(mapping = NULL, data = NULL, stat = "forecast",
if(stat=="forecast"){
paramlist <- list(na.rm = na.rm, PI=PI, series=series, ...)
if(!is.null(series)){
mapping <- ggplot2::aes_(colour = ~..series..)
if(inherits(mapping, "uneval")){
mapping$colour = quote(..series..)
}
else{
mapping <- ggplot2::aes_(colour = ~..series..)
}
}
}
else{
Expand Down

0 comments on commit b6b1605

Please sign in to comment.