DDP Assignment Presentation

Leigh Goodenough
23/5/20

Data Product: Survey of Glass Database

The Shiny App created for the Developing Data Products Assignment contains the following features:

  • A radio button to select each of the eight mineral elements included within the Glass dataset
  • A plot which is created based on the current selection of mineral
  • Brief documentation providing an outline of the purpose and use of the Shiny app

Outline of user interface functionality

The user interface output in the side panel is shown below (this doesn't include the documentation text or the main panel title).

In the sidebar the following options are presented to select from:

<!–html_preserve–>

View the refractive index (RI) properties of glass

<!–/html_preserve–>

Outline of server code

The server code is shown below:

library(shiny); library(ggplot2); library(mlbench); data("Glass")
shinyServer(function(input, output) {
    output$plot1 <- renderPlot ({
        if (input$min=="Na") {qplot(RI,Na,data=Glass,color=Type)}
        else if (input$min=="Mg") {qplot(RI,Mg,data=Glass,color=Type)}
        else if (input$min=="Al") {qplot(RI,Al,data=Glass,color=Type)}
        else if (input$min=="Si") {qplot(RI,Si,data=Glass,color=Type)}
        else if (input$min=="K") {qplot(RI,K,data=Glass,color=Type)}
        else if (input$min=="Ca") {qplot(RI,Ca,data=Glass,color=Type)}
        else if (input$min=="Ba") {qplot(RI,Ba,data=Glass,color=Type)}
        else if (input$min=="Fe") {qplot(RI,Fe,data=Glass,color=Type)}
    })
})

Plot Output Example

Here is an example of the plot output, when “Potassium” is selected as the mineral to inspect:

plot of chunk unnamed-chunk-1