Created on the 3rd of August 2021
8/3/2021
Created on the 3rd of August 2021
The Iris flower data set or Fisher’s Iris data set is a multivariate data set introduced by the British statistician and biologist Ronald Fisher in his 1936 paper The use of multiple measurements in taxonomic problems as an example of linear discriminant analysis.
Source: Wikipedia
library(shiny)
shinyUI(fluidPage(
titlePanel("Iris Dataset"),
sidebarLayout(
sidebarPanel( h4('Select your x and y variables'),
radioButtons("x", "Select X-axis:",
list("Sepal.Length"='a', "Sepal.Width"='b', "Petal.Length"='c', "Petal.Width"='d')),
radioButtons("y", "Select Y-axis:",
list("Sepal.Length"='e', "Sepal.Width"='f', "Petal.Length"='g', "Petal.Width"='h')) ),
mainPanel( h3('Results of scatterplot'),
h4('This is the results of the scatterplot. You can play with the x and y coordinates by selecting from the menu and plot the result below. The plot instantly represent your selection. '),
plotOutput("distPlot"),
h4(" This shiny app is produced for the course assignment in Coursera Developing Products - Week 4")) ) ))
library(shiny)
shinyServer(function(input, output)
{ output$distPlot <- renderPlot({
if(input$x=='a'){ i<-1 }
if(input$x=='b'){ i<-2 }
if(input$x=='c'){ i<-3 }
if(input$x=='d'){ i<-4 }
if(input$y=='e'){ j<-1 }
if(input$y=='f'){ j<-2 }
if(input$y=='g'){ j<-3 }
if(input$y=='h'){ j<-4 }
s <- iris[, i]
k <- iris[, j]
plot(s,k) }) })
This is the basic representation of how shiny app works. If you spend more time to learn, you will definetely create apps with more features. YOu can reach the app from this link https://ali-x.shinyapps.io/project/