Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data_noNA <- data %>%
- mutate(`Intentional Release (Barrels)` = ifelse(is.na(`Intentional Release (Barrels)`), 0, `Intentional Release (Barrels)`)) %>%
- filter(!is.na(`Accident State`))
- ds_efficiency <- data_noNA %>%
- group_by(`Accident State`) %>%
- summarize(
- mean_percentage = mean(((`Liquid Recovery (Barrels)`) / (`Unintentional Release (Barrels)`+`Intentional Release (Barrels)`)), na.rm = TRUE) # Calcolo percentuale e media
- )
- ggplot(ds_efficiency, aes(x = reorder(`Accident State`, mean_percentage), y = mean_percentage)) +
- geom_bar(stat = "identity") +
- labs(
- title = "EFFICIENZA DI RECUPERO MEDIO DI BARILI PER OGNI STATO",
- x = "STATO",
- y = "FREQUENZA"
- ) +
- theme_minimal()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement