[英]Modify axes in control chart RStudio
I would like to ask a help in modify axes in control chart in RStudio, by qcc package.我想通过 qcc package 请求帮助修改 RStudio 控制图中的轴。
Generated a controlchart type EWMA, in the axes x, appear group, sequencially (that represents each observations), but I need insert an information about year (divide group into sequence of year).生成了一个控制图类型 EWMA,在轴 x 中,按顺序出现组(表示每个观察值),但我需要插入有关年份的信息(将组划分为年份序列)。 I tried using the command (axes), but doesn't work.
我尝试使用命令(轴),但不起作用。
Which command or function it is possible to modify to achieve this?可以修改哪个命令或 function 来实现此目的?
Thank you very for help!非常感谢您的帮助!
Yours faithfully您忠诚的
Guilherme吉尔赫姆
The ewma
function in qcc
accepts a labels
parameter: a character vector of labels for each group. ewma
中的qcc
接受labels
参数:每个组的标签字符向量。 You could, for instance, do something like:例如,您可以执行以下操作:
library(qcc)
data(pistonrings)
attach(pistonrings)
diameter <- qcc.groups(diameter, sample)
label_x <- as.character(seq.Date(from = as.Date("2020/01/01"), length.out = 25, by = "day"))
q2 <-
ewma(
diameter[1:25, ],
center = 0,
lambda = 0.4,
std.dev = 0.57,
nsigmas = 3,
add.stats = FALSE,
labels = label_x
)
And end up with a properly labelled x-axis in your EWMA plot:最后在您的 EWMA plot 中获得正确标记的 x 轴:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.