15/08/2020

Lesson

This peer assessed assignment has two parts. First, you will create a Shiny application and deploy it on Rstudio’s servers. Second, you will use Slidify or Rstudio Presenter to prepare a reproducible pitch presentation about your application.

The application must include the following:

  • Some form of input (widget: textbox, radio button, checkbox, …)
  • Some operation on the ui input in sever.R
  • Some reactive output displayed as a result of server calculations
  • You must also include enough documentation so that a novice user could use your application.
  • The documentation should be at the Shiny website itself. Do not post to an external link.

Data

cvd <- read.csv2("CVD.csv")
cvd
##            X  USA BRAZIL AUSTRALIA FRANCE  UK CANADA ITALY SPAIN RUSSIA INDIAN
## 1 14/08/2020 1234   1060        14     18   0     14     3    26    114   1007
## 2 13/08/2020 1149   1262         9     17 180      4     6     5    124    942
## 3 12/08/2020 1486   1175        21     17   0      6    10     3    129    834
## 4 11/08/2020 1334   1274        18     14   8      5     6     1    130    871
## 5 10/08/2020  432    572        18     12  55      6     4     1     70   1007
##   PORTUGAL NETHERLAND
## 1        2          4
## 2        6          2
## 3        3          2
## 4        2          0
## 5        3          3

ui.r

library(shiny)
cvd <- read.csv2("CVD.csv")
fluidPage(     
  titlePanel("Covid deaths per country"), 
  sidebarLayout(       
    sidebarPanel(p(strong("Documentation:",style="color:red"), a("User Help Page",href="https://rpubs.com/Jadson-Correa/649259")), 
                 selectInput("Country", "Country:",  
                             choices=colnames(cvd[-1])), 
                 hr(), 
                 helpText("Covid deaths") 
    ), 
    mainPanel( 
      plotOutput("deaths")   
    ) 
  ) 
) 

server.r

## function(input, output) { 
##   
##   # Fill in the spot we created for a plot 
##   output$deaths <- renderPlot({ 
##     
##     # Render a barplot 
##     barplot(cvd[,input$Country],  
##             main=input$Country, 
##             ylab="Number of covids deaths per country", 
##             xlab="Day") 
##   })
## }

https://jadson-correa.shinyapps.io/data_products/