plot.window(...)中的错误:在绘图中需要有限的'xlim'值

时间:2017-03-09 23:47:41

标签: r plot

输入数据:

# A tibble: 11 × 2
                                       TESTCELL_CONTENT Conversion
                                                  <chr>      <dbl>
1         PRGRS_00_00215_Recipe:Classic Chicken Pot Pie          2
2            PRGRS_00_00215_Recipe:Smothered Pork Chops          6
3      PBCRS_00_00215_Recipe:Easy Crescent Veggie Pizza          2
4  PRGRS_00_00215_Recipe:Cheesy Potato Slow-Cooker Soup          2
5              PRGRS_00_00211_Recipe:Loaded Potato Soup          3
6              PBSWT_00_00215_Recipe:Apple Pie Cupcakes          4
7              PRGRS_00_00215_Recipe:Loaded Potato Soup          4
8                 PRGRS_00_00215_Recipe:Chicken Marsala          5
9        PRGRS_00_00215_Recipe:Slow-Cooker Lasagna Soup          4
10                PBCRS_00_00215_Recipe:Pizza Pinwheels          2
11           PBCRS_00_00215_Recipe:Raspberry Baked Brie          3

当我绘制

plot(Conversion~TESTCELL_CONTENT, data=input)

我收到此错误: plot.window(...)出错:需要有限'xlim'值

我检查了“na”和缺失值。我限制为11条记录,但数据完整,但仍然出现错误。帮助

1 个答案:

答案 0 :(得分:2)

将你的角色转换为一个因子,你可以做到。

input$TESTCELL_CONTENT = factor(input$TESTCELL_CONTENT)

如果这是一个数据框而不是“tibble”,则同样适用。