Audrey Clausell
2023-08-27
Welcome to my presentation about my Shiny app!
Here’s a brief overview of what my app does.
Based on the IRIS data available in the ggplot2 package, my app calculate the mean of one variable (sepal.length, sepal.width,petal.length, petal.width) and one specie.
The user select both the variable and the sepcie with 2 different boxes where varaibles are written.
Let’s take a look at some data from the app using R code:
## Sepal.Length Sepal.Width Petal.Length Petal.Width Species
## 1 5.1 3.5 1.4 0.2 setosa
## 2 4.9 3.0 1.4 0.2 setosa
## 3 4.7 3.2 1.3 0.2 setosa
## 4 4.6 3.1 1.5 0.2 setosa
## 5 5.0 3.6 1.4 0.2 setosa
## 6 5.4 3.9 1.7 0.4 setosa
In server, the app calls packages :
I add “if (!is.null(selected_var) && !is.null(selected_species))” to not bug the app. The user can’t click “calculate” when boxes are empty.
2 select inputs :
“selectInput(”variable”, “Select a Variable:”, choices = colnames(iris[1:length(iris)-1]))” for the variable, removing the last column (specie) to select only numeric
“selectInput(”species”, “Select a Species:”, choices = unique(iris$Species))”
One action button : “actionButton(”calculate”, “Calculate Mean”)”
Space, Right Arrow or swipe left to move to next slide, click help below for more details