Skip to content

Commit

Permalink
Update summary_script.R
Browse files Browse the repository at this point in the history
Use count instead
  • Loading branch information
usr110 committed Nov 6, 2024
1 parent afab447 commit 07b8af9
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions summary_script.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,18 @@ combine_summary <- bind_rows(states_base_sum, states_cyc_sum) |> mutate(scenario

plotly::ggplotly(

combine_summary |>
filter(freq >= 1L) |>
ggplot() +
aes(x = name, y = freq, fill = scenario) +
geom_col(position = "dodge2") +
scale_fill_hue(direction = 1) +
theme_minimal() +
theme(axis.text.x = element_text(angle = 90L)) +
facet_wrap(vars(value))
combine_summary %>%
filter(freq >= 2) %>%
ggplot() +
aes(x = name, y = nv, fill = scenario) +
geom_bar(stat = "summary", fun = "sum", position = "dodge2") +
scale_fill_hue(direction = 1) +
coord_flip() +
theme_minimal() +
geom_text(aes(label = nv),
position = position_dodge(width = .9), size = 2) +
facet_wrap(vars(value)) +
labs(x = "diseases", y = "values")

)

Expand Down

0 comments on commit 07b8af9

Please sign in to comment.