Skip to content

Instantly share code, notes, and snippets.

@rsalaza4
Last active January 22, 2020 16:23
Show Gist options
  • Save rsalaza4/c095f350078a5ff707d8a4e7c8848e1a to your computer and use it in GitHub Desktop.
Save rsalaza4/c095f350078a5ff707d8a4e7c8848e1a to your computer and use it in GitHub Desktop.
# 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
df <- data.frame(defects, sample_size)
# Create the np-chart
c_chart <- with(df, qcc(df$defects, df$sample_size, type = "c", data.name = "defects"))
# Get the summary for the chart
summary(c_chart)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment