library(shiny)
library(tidyverse)
## -- Attaching packages --------------------------------------- tidyverse 1.3.1 --
## v ggplot2 3.3.5     v purrr   0.3.4
## v tibble  3.1.6     v dplyr   1.0.7
## v tidyr   1.2.0     v stringr 1.4.0
## v readr   2.1.2     v forcats 0.5.1
## Warning: package 'readr' was built under R version 4.1.3
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
library(plotly)
## Warning: package 'plotly' was built under R version 4.1.3
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
library(rsconnect)
## Warning: package 'rsconnect' was built under R version 4.1.3
## 
## Attaching package: 'rsconnect'
## The following object is masked from 'package:shiny':
## 
##     serverInfo

#connect to my shinyapp io account and start the app

## Preparing to deploy application...DONE
## Uploading bundle for application: 8293898...DONE
## Deploying bundle: 6839460 for application: 8293898 ...
## Waiting for task: 1272786518
##   building: Parsing manifest
##   building: Building image: 8086393
##   building: Fetching packages
##   building: Installing packages
##   building: Installing files
##   building: Pushing image: 8086393
##   deploying: Starting instances
##   rollforward: Activating new instances
##   terminating: Stopping old instances
## Application successfully deployed to https://vyluvsshiny.shinyapps.io/rprogramming/

Intro

Hi! My shiny app program lives here and can be run online viahere aswell

1) Create a visualization that allows you to rank States by crude mortality for each cause of death.

For this question, there were several asks from the question.

-Only looking for data from 2010 -Ranking crude mortality rates across all fifty states -filtering entries by cause of mortality

For this graph, we can filter our data set with dplyr’s filter setting to include only entries from 2010. As we want to rank the states by its crude morality rate, it appears we are looking for a bar graph to display the percentage by state. We can filter by a singular cause with our button option, which changes our statistics each pull. In our live feed link here, we can filter and see the states crude mortality by cause in 2010.

3)Create a visualization that lets your clients see one cause of death at the time through the years

For this question , the asks are listed below. -Change in the morality rate over time -Compared to the national average= a baseline -one cause of death at the time

Like in the previous question, there is no ask to show a singular state in our chart. The only difference is that we are plotting a line chart to show the mortality rate over the decades. For this question, I found a way to keep both graphs in the same server as debugging the reactive state was a bit of a challenge (thank you breakpts!!). The resource here help me understand the reactive state, as I see it as the playground for our temporary values. It acts as a host for any new sessions as assigning values with input$ did not work outside this function.