【问题标题】:type numeric not supported by autoplot自动绘图不支持输入数字
【发布时间】:2017-03-02 02:09:17
【问题描述】:

我看到了 autoplot 不支持但不是数字类型的对象的其他错误。 example1 example2

假设我创建了一些随机数

require(ggfortify)
require(ggplot2)

data <- c(.034,0343,0343,.0653,.034,0343,0343,.0653)

autoplot(data)

Error: Objects of type numeric not supported by autoplot.

我将不胜感激!

【问题讨论】:

  • 你期待的究竟是什么样的情节?不确定所需的输出是什么。

标签: r ggplot2


【解决方案1】:

数据必须是时间序列格式而不是数字

autoplot(ts(data))

【讨论】:

  • autoplot() 是一个通用函数,支持超过 50 个不同的类。时间序列只是一个。请参阅methods(autoplot) 以查看您可以通过的所有其他类型的东西。
  • 答案中的评论可能有不同的措辞。重要的是代码解决了我问的问题
猜你喜欢
  • 2015-07-15
  • 1970-01-01
  • 2019-04-01
  • 1970-01-01
  • 1970-01-01
  • 2019-09-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多