[英]ggfortify::autoplot or ggfortify:::autoplot not working
[英]ggfortify autoplot timeseries x-axis is not as expected
我正在嘗試從時間序列數據創建一個分面圖......
if(!require('fma')){
install.packages("fma")
library(fma)
}
if(!require('ggfortify')){
install.packages("ggfortify")
library(ggfortify)
}
ec <- ts(econsumption, frequency = 12)
ec
這導致...
Mwh temp
Jan 1 16.3 29.3
Feb 1 16.8 21.7
Mar 1 15.5 23.7
Apr 1 18.2 10.4
May 1 15.2 29.7
Jun 1 17.5 11.9
Jul 1 19.8 9.0
Aug 1 19.0 23.4
Sep 1 17.5 17.8
Oct 1 16.0 30.0
Nov 1 19.6 8.6
Dec 1 18.0 11.8
但是,當我嘗試繪圖時,x 軸並不像預期的那樣......
autoplot(ec, facet=T)
輸出 ...
我期待 autoplot 在 x 軸上自動設置 12 個月。 我究竟做錯了什么?
筆記 ...
str(ec)
結果是 ...
Time-Series [1:12, 1:2] from 1 to 1.92: 16.3 16.8 15.5 18.2 15.2 17.5 19.8 19 17.5 16 ...
- attr(*, "dimnames")=List of 2
..$ : NULL
..$ : chr [1:2] "Mwh" "temp"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.