This is a collection of Projects created with Shiny, a web application framework for R. Shiny makes it easy to create interactive web applications with using R code only. More details about Shiny can be found here.
- In order to run these projects in your local environment, you need to have R and RStudio installed. If they are not installed already, install R here and RStudio here.
- You need to have "Shiny" installed as an R package.
install.packages('shiny')
- It is recommended that you load Shiny before trying to run any of these projects.
library(shiny)
- Clone this repository.
- Open this project(Shiny101.Rproj) with RStudio.
- If you have loaded shiny already, type runApp() command with the name of the directory which contains the project that you want to run. Ex: If you want to run the Plot Random Values, you can simply type the following command in RStudio.
runApp('Norm')
- If you have not loaded Shiny:
shiny::runApp('Norm')
This is a simple Shiny application to plot a normal distribution of random numbers. The application is capable of dynamically changing its output(i.e. The plot) with the changes made to its parameters by the user via tweaking the controls. 6 controls are given to the user to adjust the plot.
- Number of random numbers to be plotted. This should be a positive integer.
- Minimum and maximum values for the x axis. The minimum value can be decreased upto -100 and the maximum value can be increased upto 100.
- Minimum and maximum values for the y axis. The minimum value can be decreased upto -100 and the maximum value can be increased upto 100.
- Toggle option to hide/show the label of x axis.
- Toggle option to hide/show the label of y axis.
- Toggle option to hide/show the label of the plot.
A Shiny application to plot clustering analysis done on the infamous Iris dataset. The application is capable of dynamically perform K-Means clustering on the Iris dataset with changing user inputs. There are four numerical variables in the dataset(Sepal.Length, Sepal.Width, Petal.Length, Petal.Width) that can be used with k-means clustering. 3 Controls are given to the user to adjust the clustering and the plot.
- A variable for X axis
- A variable for Y axis
- Number of clusters(Minimum of 1 and maximum of 9)
A Shiny application to predict Horsepower of a car's engine using its gas efficiency(miles per gas). The application takes a MPG value for a car and predicts its horsepower using it. Trained with the native R dataset, mtcars. Two smodels are used for prediction. One uses only the mpg value input for prediction and the other uses a new variable(mpgsp) along with the entered mpg value. The new value is derived from the mpg. It has a breaking point at 20. mpgsp of a car that has smaller mpg than 20 will be set to 0 and a car with higher mpg than 20 will be replaced with the value of mpg of the car - 20. As per the output, predictions from both models will be displayed and a plot will be rendered with the current data points from mtcars, each fitted models and predicted data points from both models. 3 controls are given to the user.
- A value for mpg.
- Option to include the fitted model for model1(Which uses only mpg).
- Option to include the fitted model for model2(Which uses mpg and mpgsp).