# Example 1: Creating a Pareto chart for defect types
defects1 <- c(rep("E", 62), rep("B", 15), rep("F", 3), rep("A", 10),
rep("C", 20), rep("D", 10))
paretoChart(defects1)
# Example 2: Creating a Pareto chart with weighted frequencies
defects2 <- c("E", "B", "F", "A", "C", "D")
frequencies <- c(62, 15, 3, 10, 20, 10)
weights <- c(1.5, 2, 0.5, 1, 1.2, 1.8)
names(weights) <- defects2 # Assign names to the weights vector
paretoChart(defects2, weight = frequencies * weights)
Run the code above in your browser using DataLab