Skip to content

Instantly share code, notes, and snippets.

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