R programming at work: Shiny to make plots into interactive dashboard apps

preview_player
Показать описание
A Shiny is a great addition to rstudio. This package provide a very easy to use templetae to convert your static plots into interactive plots, where user can interact with data using slider based inputs.

In this example michelis menten equation for enzyme iknetics has been used to demonstrate the power of shiny. The paramerets km and vmax can be adjusted with slider inouts in the app.
#rprogramming
#shiny app

#code for learning
#
# This is a Shiny web application. You can run the application by clicking
# the 'Run App' button above.
#
# Find out more about building applications with Shiny here:
#
#

library(shiny)

# Define UI for application that draws a histogram
ui =fluidPage(

# Application title
titlePanel("Michelis Menten Kinetics for enzyme catalysed reaction"),

# Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
sliderInput("km",
"Michelis constant:",
min = 1,
max = 50,
value = 30),
sliderInput("Vmax",
"Max velocity:",
min = 1,
max = 50,
value = 30),
sliderInput("S",
"Substrate conc. max limit:",
min = 50,
max = 5000,
value = 100)
),

# Show a plot of the generated distribution
mainPanel(
plotOutput("distPlot")
)
)
)

# Define server logic required to draw a histogram
server = function(input, output) {

output$distPlot = renderPlot({
# generate bins based on input$bins from ui.R
s = 1:input$S
v=input$Vmax*s/(input$km+s)

# draw the histogram with the specified number of bins
plot(s,v, col = 'blue',bty="n",type="l")
})
}

# Run the application
shinyApp(ui = ui, server = server)
Рекомендации по теме
Комментарии
Автор

Rajendra ji,
Would it be possible to create a video on solving quadratic equations in R. Thank you.

KamalSingh-dngv