require(ggplot2)
require(ggQC)
set.seed(5555)
Process1 <- data.frame(Process_run_id=1:30,
Counts=rpois(n = 30, lambda = 25))
c_base <- ggplot(Process1, aes(x=Process_run_id, y = Counts))
c_Chart <- c_base + geom_point() + geom_line() +
stat_QC(method = "c", auto.label = T, label.digits = 2)
c_Chart
set.seed(5555)
Process1 <- data.frame(Process_run_id = 1:30,
Counts=rpois(n = 30, lambda = 25),
Group = "A")
Process2 <- data.frame(Process_run_id = 1:30,
Counts = rpois(n = 30, lambda = 5),
Group = "B")
all_processes <- rbind(Process1, Process2)
c_base <- ggplot(all_processes, aes(x=Process_run_id, y = Counts))
c_Chart <- c_base + geom_point() + geom_line() +
stat_QC(method = "c", auto.label = T, label.digits = 2) +
facet_grid(.~Group)
c_Chart
set.seed(5555)
np_data <- data.frame(
trial=1:30,
Number_Nonconforming = rbinom(30, 30, prob = .50),
n = rep(15, 30))
np_Chart <- ggplot(data = np_data, aes(trial, Number_Nonconforming)) +
geom_point() + geom_line() +
stat_QC(method = "np", n=30, auto.label = T, label.digits = 1)
np_Chart
set.seed(5555)
p_data <- data.frame(trial=1:30,
Num_Incomplete_Items = rpois(30, lambda = 30),
Num_Items_in_Set = runif(n = 30, min = 50, max = 100))
p_data$Proportion_Incomplete <- p_data$Num_Incomplete_Items/p_data$Num_Items_in_Set
p_Chart <- ggplot(data = p_data, aes(trial, y=Proportion_Incomplete,
n=Num_Items_in_Set)) +
geom_point() + geom_line() +
stat_QC(method = "p")
p_Chart
set.seed(5556)
u_data <- data.frame(trial=1:30,
Num_of_Blemishes = rpois(30, lambda = 30),
Num_Items_Inspected = runif(n = 30, min = 50, max = 100)
)
u_data$Blemish_Rate <- u_data$Num_of_Blemishes/u_data$Num_Items_Inspected
u_chart <- ggplot(data = u_data, aes(x=trial,
y=Blemish_Rate,
n=Num_Items_Inspected)) +
geom_point() + geom_line() +
stat_QC(method = "u")
u_chart