Boxplot sees values that aren't there

前端 未结 1 574
南方客
南方客 2021-01-28 07:33

I have a IMDB dataset and trying to make a boxplot of a film\'s ratings.

I\'ve successfully loaded the dataset and tried to make the boxplot but it produced a really we

1条回答
  •  有刺的猬
    2021-01-28 07:37

    Factors retain their levels even after subsetting, you can drop those that are unused with droplevels:

    boxplot(rating ~ title, data=droplevels(imdb[imdb$title == "Top Gun (1986)", ]))
    

    0 讨论(0)
提交回复
热议问题