ggQC
ggQC copied to clipboard
Pareto chart order or fct_reorder
Hi, Sr. thank you for this package.
Apparently, the code is running, but I'm having some problems with the order of the frequency in the chart.
e.g( holes
has the highest value but it's the scratch
that appears first on the chart)
library(tidyverse)
library(ggQC)
df <- tibble(type_nc = c("scratch","spots","folds","holes","rips"),
qty = c(201,78,47,31,15),
cost = c(4287,2423,1119,8947,1864))
df
df %>%
ggplot(aes(x = type_nc,
y= cost)) +
stat_pareto(point.color = "navy",
point.size = 2,
line.color = "navy",
bars.fill = c("blue","lightblue"))
Thank you