Skip to content

Instantly share code, notes, and snippets.

View rsalaza4's full-sized avatar
🎯
Focusing

Roberto Salazar rsalaza4

🎯
Focusing
View GitHub Profile
# Import the qcc library
library(qcc)
# Create the defects data column
defects <- as.integer(rnorm(50, 3, 1))
# Create the sample size data column
sample_size <- as.integer(rnorm(50, 20, 3))
# Create a data frame with both columns
# Import the qcc library
library(qcc)
# Create the defects data column
defects <- as.integer(rnorm(50, 3, 1))
# Create the sample size data column
sample_size <- as.integer(rep(20, 50))
# Create a data frame with both columns
# Import the qcc package
library(qcc)
# Create the defects data column
defects <- as.integer(rnorm(50, 3, 1))
# Create the sample size data column
sample_size <- as.integer(rep(20, 50))
# Create a data frame with both columns
# Import the qcc library
library(qcc)
# Create the defects data column
defects <- as.integer(rnorm(50, 3, 1))
# Create the sample size data column
sample_size <- as.integer(rnorm(50, 20, 3))
# Create a data frame with both columns
# Import the qcc library
library(qcc)
# Create a measures column
measures <- rnorm(200, 3, 1)
# Specify the sample size
sample_size <- 5
# Get the total number of samples
# Create the R-chart
r_chart <- qcc(measure, type = "R", data.name = measure_unit)
# Get the summaries for R-chart
summary(r_chart)
# Specify the lower control limit
LSL <- as.numeric(1)
# Specify the upper control limit
USL <- as.numeric(5)
# Specify the target
Target <- as.numeric(3)
# Plot the process capability chart
# Import the qcc package
library(qcc)
# Create a vector with the number of defects per defect type
defects <- c(27, 389, 65, 9, 15, 30, 12, 109, 45, 321)
# Create a vector with the names of the defects
names(defects) <- c("Defect 1", "Defect 2", "Defect 3", "Defect 4",
"Defect 5", "Defect 6", "Defect 7", "Defect 8",
"Defect 9", "Defect 10")
# Import the SixSigma package
library(SixSigma)
# Specify the effect to be analyzed
b.effect <- "Delay"
# Create a vector with the names of the causes classification groups
b.groups <- c("Personnel", "Weather", "Suppliers", "Planning")
# Create a vector that contains the causes
# Import the SixSigma package
library(SixSigma)
# Create 50 random data points
x <- rnorm(50 ,15, 5)
# Build the run chart
plot(x,
type = "b",
pch = 16,