【问题标题】:Why is my R plot using ts_plot including a line between the first and last points?为什么我的 R 绘图使用 ts_plot 包括第一点和最后一点之间的线?
【发布时间】:2017-06-23 12:46:50
【问题描述】:

我正在使用 R 包 rtweet 流式传输和绘制有关周日超级碗赛事的推文。我已经解析了数据,并正在尝试绘制它,但是两个数据点之间有一条白线不断出现,我不知道为什么。

摆脱这条白线会很棒,因为它会分散注意力。我是一个菜鸟,所以任何帮助将不胜感激!下面是我用来绘制解析数据的代码 (superbowl)。

Here's an image of the output that I have got.

    superbowl %>% 
         ts_filter(by="7.5 mins",
                   filter=c("patriots|pats|patriotsnation","falcons|dirty birds|riseup"),
                   key=c("Patriots","Falcons"),
                   trim=TRUE) %>%
         ts_plot(theme="spacegray",
                 cols=c("#0D254C","#A6192D"),
                 main="Tweets during Super Bowl LI",
                 subtitle="Tweets collected and parsed using 'rtweet'",
                 cex.legend=1.5)

【问题讨论】:

    标签: r plot line


    【解决方案1】:

    我不太确定如何解决该问题,但替代方法可能是使用基本函数:

    plot(dataset[,1],type='l')

    其中 1 是您绘制的列的编号,l 给出了观察之间的传统时间序列线。

    【讨论】:

      猜你喜欢
      • 2017-05-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-19
      相关资源
      最近更新 更多