Skip to content
Back to skills

R Web Shiny

ASecurity

R Shiny web applications. Use for interactive dashboards, reactive programming, and production deployment with golem.

  • 5 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added June 5, 2026
datagoreactexpressdocker

Works with

  • cli

Security analysis

A100/100

Pro scans all 9 files and shows the line behind each finding

Scanned June 5, 2026

npx -y skills add LeoLin990405/r-analytics-skill --skill r-web-shiny --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of R Web Shiny?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for R Web Shiny
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/leolin990405-r-web-shiny/badge)](https://www.skillsdirectory.com/skills/leolin990405-r-web-shiny)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: r-web-shiny
description: R Shiny web applications. Use for interactive dashboards, reactive programming, and production deployment with golem.
---

# R Shiny Applications

Interactive web applications.

## Basic Structure

```r
library(shiny)

ui <- fluidPage(
  titlePanel("App Title"),
  sidebarLayout(
    sidebarPanel(
      sliderInput("n", "N:", 1, 100, 50),
      selectInput("var", "Variable:", choices = names(mtcars))
    ),
    mainPanel(
      plotOutput("plot"),
      tableOutput("table")
    )
  )
)

server <- function(input, output, session) {
  output$plot <- renderPlot({
    hist(rnorm(input$n))
  })
  output$table <- renderTable({
    head(mtcars[, input$var, drop = FALSE])
  })
}

shinyApp(ui, server)
```

## Inputs

```r
# Numeric
numericInput("num", "Number:", value = 10)
sliderInput("slider", "Slider:", min = 0, max = 100, value = 50)

# Text
textInput("text", "Text:")
textAreaInput("textarea", "Text Area:")
passwordInput("password", "Password:")

# Selection
selectInput("select", "Select:", choices = c("A", "B", "C"))
selectizeInput("selectize", "Selectize:", choices = c("A", "B"), multiple = TRUE)
radioButtons("radio", "Radio:", choices = c("A", "B"))
checkboxInput("check", "Checkbox:", value = TRUE)
checkboxGroupInput("checkgroup", "Checkboxes:", choices = c("A", "B"))

# Date
dateInput("date", "Date:")
dateRangeInput("daterange", "Date Range:")

# File
fileInput("file", "Upload:")

# Action
actionButton("btn", "Click")
downloadButton("download", "Download")
```

## Outputs

```r
# UI
plotOutput("plot")
tableOutput("table")
dataTableOutput("dt")
textOutput("text")
verbatimTextOutput("code")
htmlOutput("html")
uiOutput("dynamic")

# Server
output$plot <- renderPlot({ ... })
output$table <- renderTable({ ... })
output$dt <- renderDataTable({ ... })
output$text <- renderText({ ... })
output$code <- renderPrint({ ... })
output$html <- renderUI({ ... })
```

## Reactivity

```r
server <- function(input, output, session) {
  # Reactive expression (cached)
  data <- reactive({
    df %>% filter(x > input$threshold)
  })

  # Use reactive
  output$plot <- renderPlot({
    ggplot(data(), aes(x, y)) + geom_point()
  })

  # Reactive values
  rv <- reactiveValues(count = 0)

  observeEvent(input$btn, {
    rv$count <- rv$count + 1
  })

  # eventReactive (triggered by event)
  filtered <- eventReactive(input$go, {
    df %>% filter(x > input$threshold)
  })

  # Isolate (prevent reactivity)
  output$text <- renderText({
    input$btn  # Trigger
    isolate(input$text)  # Don't trigger on text change
  })
}
```

## Modules

```r
# Module UI
counterUI <- function(id) {
  ns <- NS(id)
  tagList(
    actionButton(ns("btn"), "Click"),
    textOutput(ns("count"))
  )
}

# Module Server
counterServer <- function(id) {
  moduleServer(id, function(input, output, session) {
    count <- reactiveVal(0)
    observeEvent(input$btn, { count(count() + 1) })
    output$count <- renderText(count())
  })
}

# Use module
ui <- fluidPage(counterUI("counter1"))
server <- function(input, output, session) {
  counterServer("counter1")
}
```

## golem (Production)

```r
# Create golem app
golem::create_golem("myapp")

# Structure
# R/app_ui.R - UI
# R/app_server.R - Server
# R/mod_*.R - Modules
# dev/run_dev.R - Development

# Deploy
golem::add_dockerfile()
rsconnect::deployApp()
```

Files in this skill

  • SKILL.md3.3 KB
  • bslib/SKILL.md1.4 KB
  • flexdashboard/SKILL.md2.3 KB
  • golem/SKILL.md1.4 KB
  • shiny/SKILL.md3.5 KB
  • shinyWidgets/SKILL.md2.7 KB
  • shinydashboard/SKILL.md2 KB
  • shinyjs/SKILL.md1.4 KB
  • shinythemes/SKILL.md1.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.