| title: "Self-Harm by Gender in Australia 2012-2021" output: flexdashboard::flex_dashboard: orientation: columns vertical_layout: fill column_widths: c(650,350) |
Chart A
p1 <- plot_ly(data = suicide, x = ~Year, y = ~Count, type = "bar", color = ~Gender,
colors = c("Pink","Light Blue")) %>%
layout(title = "Number of Suicides by Gender in Australia 2012-2021",
yaxis = list(zeroline = FALSE, title = "Count"),
xaxis = list(zeroline = FALSE, title = "Year"))
p1
## Warning: `arrange_()` was deprecated in dplyr 0.7.0.
## Please use `arrange()` instead.
## See vignette('programming') for more help
Chart B
p2 <- plot_ly(data = suicide, x = ~Year, y = ~Hospitalization, type = "bar", color = ~Gender,
colors = c("Pink","Light Blue")) %>%
layout(title = "Number of Self-Harm Hospitalizations by Gender in Australia 2012-2021",
yaxis = list(zeroline = FALSE, title = "Hospitalization"),
xaxis = list(zeroline = FALSE, title = "Year"))
p2
Chart C
suicidemale <- read.csv("suicide3.csv")
p3 <- plot_ly(data=suicidemale, labels = ~Method, values = ~Count, type = 'pie')
p3 <- p3 %>% layout(title = 'Intentional Self-Harm by Method by Males in Australia from 2012-2021',
xaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE),
yaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE))
p3
### Chart D
suicidefemale <- read.csv("Suicide4.csv")
p4 <- plot_ly(data=suicidefemale, labels = ~Method, values = ~Count, type = 'pie')
p4 <- p4 %>% layout(title = 'Intentional Self-Harm by Method by Females in Australia from 2012-2021',
xaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE),
yaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE))
p4