我试图在r markdown文件中创建一个pareto图表(来自qcc包)。
bondfailures <- read.csv("BondFailures.csv", header = T)
totalbondfailures <- bondfailures$Total
names(totalbondfailures) <- c("Degrease", "Chemical Treatments", "Incompatability", "Bad Storage", "Bad Refrigeration", "Bad Rolling", "Curling Temp", "Curling Humidity")
par("mar")
pareto.chart(totalbondfailures, ylab="Frequency", xlab="Defect Category", main="Pareto Diagram of Total Number of Failures by Defect Category")
它正在读取数据,但是当我尝试创建pareto图表时,我收到以下错误消息:
Error in par(bg = qcc.options("bg.margin"), mar = pmax(par("mar") + mar, :
invalid value specified for graphical parameter "mar"
我做错了什么?
答案 0 :(得分:0)
由于数据集中存在NA值,可能会发生这种情况。使用na.omit(bondfailures)删除NA和pareto.chart将正常工作!