7/17/2020

Coursera / John Hopkins Data Science Specialization

Course 9 - Week 4 Course Project

Creating a Shiny Application with Reactive Operations

Overview:

In this assignment, a Shiny application was created allowing a linear model to be created based on the selected data points on the plot by the user.

The dataset used is “mtcars”. The application plots the MPG vs Weight variables.

In the application, the user can specify the minimum number of data points required to be selected for model generation (i.e.: greater than or equal to 2).

Upon mouse selection of data points on the plot, a linear model of the selected points is determined dynamically. The corresponding slope and y-intercept values are returned and displayed.

The “mtcars” plot referenced in the application is as follows:

library(plotly)
library(tidyr)
library(dplyr)
plot_ly(mtcars, x = ~wt, y = ~mpg, width = 600, height = 300)

The application is available on link.

Thank you.