试过了q5[4]<-NULL
了两次,因为它们保存了我想要摆脱的点的值,但后来我收到一个错误,说“x”和“y”长度不同。
这是代码:
q5data<-structure(list(x = c(1045L, 1055L, 1037L, 1064L, 1095L, 1008L,
1050L, 1087L, 1125L, 1146L, 1139L, 1169L, 1151L, 1128L, 1238L,
1125L, 1163L, 1188L, 1146L, 1167L)), .Names = "x", class = "data.frame",row.names = c(NA,
-20L))
library(qcc)
qcc.options(bg.margin = "transparent")
q5<-ewma(q5data, center=1050,nsigmas=2.7,lambda=0.1,ylab="Molecular Weight",xlab="Observation",title="EWMA Chart for Molecular Weight")