ts <- read.csv("https://raw.githubusercontent.com/forvis/forvision_data/master/example1_TSTS.csv")
head(ts, 10)
## series_id value timestamp
## 1 Y1 3103.96 1984
## 2 Y1 3360.27 1985
## 3 Y1 3807.63 1986
## 4 Y1 4387.88 1987
## 5 Y1 4936.99 1988
## 6 Y1 5379.75 1989
## 7 Y1 6158.68 1990
## 8 Y1 6876.58 1991
## 9 Y2 5389.80 1984
## 10 Y2 5384.40 1985
fs - FTS schema, origin - forecast origin, and m-forecast method то функция plotFixedOrigin() строит график выбранного временного ряда:time-based object то выводится ошибка:library(forvision)
plotFixedOrigin(ts = ts, id ="Y1")
Error in plotFixedOrigin(ts = ts, id = “Y1”, origin = 1988) : The column timestamp of TSTS schema requires an appropriate time-based object
time-based object c использованием zoo пакета:library(forvision)
library(zoo)
ts$timestamp <- as.yearmon(ts$timestamp)
plotFixedOrigin(ts = ts, id ="Y1")
fs - FTS schema, origin-forecast origin, and m-forecast method:timestamp of FTS не в виде time-based object то также выводится ошибка:library(forvision)
fs <- read.csv("https://raw.githubusercontent.com/forvis/forvision_data/master/example1_FTS.csv")
plotFixedOrigin(ts = ts, fs = fs, id ="Y1", origin =1988, m = c("A", "B") )
Error in plotFixedOrigin(ts = ts, fs = fs, id = “Y1”, origin = 1988, m = c(“A”, : The column timestamp of FTS shema requires an appropriate time-based object
time-based object:library(forvision)
fs <- read.csv("https://raw.githubusercontent.com/forvis/forvision_data/master/example1_FTS.csv")
fs$timestamp <- as.yearmon(fs$timestamp)
plotFixedOrigin(ts = ts, fs = fs, id ="Y1", origin =1988, m = c("A", "B"))