[R] Prophet package

Jim Lemon drjimlemon at gmail.com
Sun Mar 19 21:38:33 CET 2017


Hi Andras,
Did you get a plot from your plot command? It looks to me as thought
there was an error, perhaps because the plot command tried to treat
"forecast" as a vector.

Jim

On Mon, Mar 20, 2017 at 5:43 AM, Andras Farkas via R-help
<r-help at r-project.org> wrote:
> Dear All
>
>
> wonder if you could assist with the following
>
> we have:
>
> library(prophet)
>
> library(dplyr)
>
>
> abc<-c(0.3684693,0.4938679, 0.4429201,0.452598,0.4301452,0.4315169,
> 0.447026,0.496179,0.4045693,0.398533, 0.3551111,0.431079,0.4063136,0.4120126,0.5210375,0.402897,0.4466131,0.5005669,0.5014164,0.5042271,0.5498575,0.6014215,0.4415863,0.4377443,0.4316092,0.4156757,0.3517915,0.3669508,0.3899471,0.3964143,0.4001074,0.3851003,0.4222451,0.375324,0.3652045,0.3376978
> ,0.383012,0.3763665,0.3550609,0.2958678,0.3726571,0.3442298
> #,0.3403275,0.2973978
> #, 0.4,0.4,0.4, 0.4,0.4,0.4, 0.4,0.4,0.4
>
> )
>
> df<-data.frame(ds = seq(as.Date('2013-08-01'), as.Date('2017-01-01'), by = 'm'),abc)
> names(df)<-c("ds","y")
>
>
> m<-prophet(df,yearly.seasonality = TRUE)
> future <- make_future_dataframe(m, periods = 730)
> forecast <- predict(m, future)
> plot(m, forecast)
> points(x=as.Date('2017-02-01'),y=0.5)
>
> results in error message :
>
>
> Error in plot.xy(xy.coords(x, y), type = type, ...) :
> plot.new has not been called yet
>
> would you have a solution to plot the point on the plot?
>
> appreiate the help,
>
> Andras Farkas,
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list