2017-05-31 52 views
0

我想繪製箱形圖。我有超過1000行,但當我繪製它們時,它只顯示幾個條目。無法在R中繪製所有數據繪圖

數據集: 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

任何人都可以請給一個提示如何解決?

+0

你確定Machine_Plant變量是一個因素嗎?嘗試:boxplot(溫度〜as.factor(Machine_Plant)) –

回答

0

你是說'它只顯示幾個條目'?如果你的問題是關於有隻有4註釋X軸箱線,解決方案可能是這樣的:

boxplot(Temperature ~ Machine_Plant, las=3) 

類型

?par 

,瞭解更多有關las參數。

+0

謝謝。它解決了:) –