I have an object forecast
. When I execute:
class(forecast)
I get:
[1] "mts" "ts" "matrix"
Does this mean that this is a list of 3 objects of which the last one is a matrix?
When I do:
str(forecast)
I get:
Time-Series [1:5, 1:3] from 8153 to 8157: 52 52 52 51 51 ...
- attr(*, "dimnames")=List of 2
..$ : NULL
..$ : chr [1:3] "fit" "upr" "lwr"
When I do:
head(forecast)
I get:
fit upr lwr
[1,] 51.77675 57.21211 46.34138
[2,] 51.67965 57.22266 46.13664
[3,] 51.58255 57.36042 45.80468
[4,] 51.48545 57.65884 45.31206
[5,] 51.38835 58.13347 44.6432
How do I get the separate values of the first row as indicated by this pseudo code please:
fit upr lwr
[1,] 51.77675 57.21211 46.34138
fit <- ?
upr <- ?
lwr <- ?