Ich versuche, eine Liste von Header-Namen von einem Benutzer hochgeladen Excel-Blatt als die Auswahloptionen auf der linken Hand Auswahlfeld, für die benutzerdefinierte Eingabe-Steuercode wie unter http://shiny.rstudio.com/gallery/custom-input-control.htmlVerwenden von Excel-Spaltenüberschriften für Shinys "custom-input-control" -Beispiel
Das Auswahlfeld zeigt nur den Textdatensatz .. anstelle aller Überschriften.
Mein aktueller Code ist
ui.r:
library(shiny)
source("chooser.R")
shinyUI(fluidPage(# Application title
titlePanel("Linear Regression"),
mainPanel(tabsetPanel(
tabPanel("Upload",
# Sidebar with a slider input for number of bins
sidebarLayout(
wellPanel(
fileInput(
'file1',
'Choose XLSX File',
accept = c('sheetName', 'header'),
multiple = FALSE
)
)
,
mainPanel(tableOutput('contents'))
)),
tabPanel("Choose",
sidebarLayout(
sidebarPanel(
chooserInput("mychooser", "Available Rows", "Chosen Rows",
unlist(strsplit("dataset", split=",")) , c(), size = 10, multiple = TRUE
),
verbatimTextOutput("selection")
) ,
mainPanel("")
))
))))
server.r:
library(shiny)
require(gdata)
shinyServer(function(input, output) {
output$contents <- renderTable({
inFile <- input$file1
if (is.null(inFile))
return(NULL)
read.xls(inFile$datapath,1)
})
output$dataset<-reactive({
inFile <- input$file1
colnames(read.xls(inFile$datapath, 1))
})
output$selection <- renderPrint(
input$mychooser
)
})