Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(shiny)
- library(tidyverse)
- library(readxl)
- server <- function(input, output) {
- names <- reactive({ read_excel(input$file1$name, sheet = 1,
- range = "A1:P1", col_names = TRUE)
- })
- }
- library(shiny)
- library(shinythemes)
- ui <- fluidPage(
- theme=shinytheme("readable"),
- # App title ----
- titlePanel("App_1"),
- # Sidebar layout with input and output definitions ----
- sidebarLayout(
- # Sidebar panel for inputs ----
- sidebarPanel(
- # Input: Select a file ----
- fileInput("file1", "Choose File",
- multiple = FALSE),
- # Horizontal line ----
- tags$hr(),
- checkboxGroupInput("show_vars", "Columns in diamonds to show:", names(names) )
- )
- )
- )
- observe({
- if (is.null(input$file1))
- return(NULL)
- cnames <- colnames(names())
- updateCheckboxGroupInput(session, inputId = "show_vars", choices = cnames)
- })
Add Comment
Please, Sign In to add comment