【问题标题】:Using R- trying to plot frequency table使用 R- 尝试绘制频率表
【发布时间】:2022-08-11 01:05:41
【问题描述】:

(1) 我有一个名为 resdf 的频率表,看起来像这样-here is the table

(2)这是我尝试使用的代码行 awards_given<-hist(resdf$Year,resdf$Freq,type=\"h\",breaks=seq(0,88,by=10))

(3) 我得到这个错误

Error in hist.default(resdf$Year, resdf$Freq, type = \"h\", breaks = seq(0,  : 
  some \'x\' not counted; maybe \'breaks\' do not span range of \'x\'
  • 您不能使用 hist() 绘制 2 个变量。

标签: r ggplot2


【解决方案1】:

直方图只需要一个向量作为输入。你放了两个。 我想这就是你想要的:

hist(resdf$Freq)

【讨论】:

    猜你喜欢
    • 2023-04-08
    • 2017-12-23
    • 1970-01-01
    • 1970-01-01
    • 2011-05-03
    • 2013-06-29
    • 1970-01-01
    • 2016-01-02
    • 1970-01-01
    相关资源
    最近更新 更多