R/cumulative_indicator.R
cumulative_indicator.Rd
This function aims to simplify the code in c19euxplorer
shiny app by selecting
country, date, and indicators in cumulative data to be visualized in Cases and Deaths Tab.
This function would be used in the app.R file.
cumulative_indicator( df, indicator = c("Cases", "Cases per 10,000 people", "Deaths", "Deaths per 10,000 people") )
df | A cumulative COVID-19 tibble. |
---|---|
indicator | A shiny's input_id of indicator to be visualized. |
A data frame containing the country, date, and the indicator.
You can also use this function outside the app. However, make sure to have these variables (with the exact same name) in your data frame in order to make the function works.
cumulative_cases
cumulative_deaths
cumulative_cases_rate
cumulative_deaths_rate
country
date
if (FALSE) { cumulative_indicator(covid_eu_cumulative, input$indicator_select) }