0

PerformanceAnalytics ライブラリの chart.TimeSeries を使用して、時系列データ セットにさまざまなイベントをプロットしようとしています。の例に従おうとしましたが、何かが足りないと思います。 ExampleChart マイチャート

垂直イベント ラインも期間エリアもチャートに表示されません。私のコードはサンプルコードとほぼ同じです。何か案は?

risk.dates = c(
  "2015-04-19"
  )
risk.labels = c(
  "Jon Oliver's Patent Episode "
  )

cycle.dates <- c ("2015-1-01/2015-01-31",
                      "2015-03-01/2015-03-31",
                      "2015-05-01/2015-05-31",
                      "2015-07-01/2015-07-31"
                      )
chart.TimeSeries(df, colorset = "darkblue",
                 date.format.in = "%Y-%m-%d",
                 legend.loc = NULL,
                 period.areas = cycles.dates,
                 period.color = "lightblue",
                 event.lines = risk.dates,
                 event.labels = risk.labels,
                 event.color = "red", lwd = 2,
                 main = "Reddit Sentiment Index",
                 auto.grid = FALSE)

df <- data.frame(DateTime=
          c("2/17/2015","2/18/2015","2/19/2015",
            "2/20/2015","2/21/2015","2/22/2015", 
            "2/23/2015","2/24/2015","2/25/2015",
            "2/26/2015","2/27/2015","2/28/2015",
            "2/28/2015","2/27/2015"),
           AvgSentimentScore=
             c("NA","NA","NA","NA","NA","NA","NA","NA","NA",
               "8.405975696","8.313470536","8.414560335",
                "8.720865075","9.284902246"))
4

0 に答える 0