Danilo Freire
17th November, 2014
My idea was very simple: to create an easy-to-use app that shows the bivariate relationships between variables in the famous iris dataset. The five variables can be seen with the following piece of code:
names(iris)
[1] "Sepal.Length" "Sepal.Width" "Petal.Length" "Petal.Width"
[5] "Species"
There are two ways of adding a line to the graph, either using a simple linear model (lm), or a local regression smoothing line (loess). Here's an example: the relationship between Petal.Length and Petal.Width, with a loess smoother:
The server actually runs a very simple piece of code. It does the following
library(shiny)
library(ggplot2)
shinyServer (function (input, output) {
output$plot <- renderPlot ({
ggplot (iris, aes_string(input$x, input$y)) +
geom_point() + geom_smooth (method = input$smoother)
})
})
The app is hosted at the following address: