【问题标题】:Cannot plot all data in box-plotting in R无法在 R 中的箱线图中绘制所有数据
【发布时间】:2017-10-31 23:57:09
【问题描述】:

我想制作一个箱形图。我有超过 1000 行,但是当我绘制它们时,它只显示几个条目。

数据集: https://www.dropbox.com/s/tgaqfgm2gkl7i3r/maintenance_data_updated.csv

   #Start of Box plot Temperature
    training_data <- read.csv("C:/Users/akhan/Documents/maintenance_data_updated_2.csv", stringsAsFactors = TRUE)
    library(dplyr)
    dt_temperature <- select(training_data, Runtime, Defect, Machine, Temperature, Plant)
    dt_temperature$Machine_Plant = paste(dt_temperature$Machine,dt_temperature$Plant,sep = "_")
    attach(dt_temperature)
    class(Temperature)
    class(Defect)
    class(Runtime)
    class(Machine)
    ?boxplot
    boxplot(Temperature ~ Machine_Plant)

当前输出:https://www.dropbox.com/s/7nv5n80en1vpkyt/Rplot01.png

谁能指点一下解决办法?

【问题讨论】:

  • 您确定 Machine_Plant 变量是一个因素吗?试试:boxplot(Temperature ~ as.factor(Machine_Plant))

标签: r statistics data-mining boxplot


【解决方案1】:

“它只显示几个条目”是什么意思?如果您的问题是关于在 X 轴上仅注释 4 个箱线图,则解决方案可能是这样的:

boxplot(Temperature ~ Machine_Plant, las=3)

类型

?par

更多关于las参数的信息。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-21
    • 2012-08-21
    • 1970-01-01
    • 2016-02-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多