R:响应功能中的fileInput存在问题(未找到ui)
我已经在shiny中构建了一个应用程序。它有时工作,有时崩溃,我不知道该怎么办 该应用程序的基本思想是允许用户上传xlsx文件。应用程序使用该算法并返回应用程序上的表 目前我的问题是: 有效错误(ui):找不到对象“ui” 用户界面代码是R:响应功能中的fileInput存在问题(未找到ui),r,shiny,R,Shiny,我已经在shiny中构建了一个应用程序。它有时工作,有时崩溃,我不知道该怎么办 该应用程序的基本思想是允许用户上传xlsx文件。应用程序使用该算法并返回应用程序上的表 目前我的问题是: 有效错误(ui):找不到对象“ui” 用户界面代码是 ui<- fluidPage( sidebarLayout( sidebarPanel( fileInput("file", "Upload the list", accept = c(".xlsx"), bu
ui<-
fluidPage(
sidebarLayout(
sidebarPanel(
fileInput("file", "Upload the list", accept = c(".xlsx"), buttonLabel = "Seach"),
sliderInput("max", "max in groups:",
min = 11, max = 17, value=14),
sliderInput("min", "min in groups:",
min = 5, max = 9, value=7))),
mainPanel(
tableOutput('grouped')
))
server <- function(input,output){
dataInput <- reactive({
func <- function (val,valm) {
# ====
# ====== input ==========
inFile<- input$file
library(readxl)
library(plyr)
ext <- "xlsx"
file.rename(inFile$datapath,
paste(inFile$datapath, ext, sep="."))
members <- read_excel(paste(inFile$datapath, ext, sep="."), 1)
#members <- read_excel(inFile$datapath)
members$free <- 0
members$free2 <- 0
members$free3 <- 0
members$freeENG <- 0
members$freeENG[members$`English Required` == "no"] <- 1
#View(members)
groups <- data.frame("Effective Communication"=character(20),
"Decision Making and Problem Solving"= character(20),
"Feedback Is a Gift"=character(20),
"Fierce Accountability"=character(20),
"ME During Change"=character(20),
"Assertiveness Training"=character(20),
stringsAsFactors=FALSE)
i=1
miss = TRUE
missENG = TRUE
ECG= matrix(c(1, "Effective.Communication"),nrow=1)
DMG= matrix(c(1, "Decision.Making.and.Problem.Solving"),nrow=1)
FBG= matrix(c(1, "Feedback.Is.a.Gift"),nrow=1)
FAG= matrix(c(1,"Fierce.Accountability"),nrow=1)
MEG= matrix(c(1, "ME.During.Change"),nrow=1)
ASG= matrix(c(1, "Assertiveness.Training"),nrow=1)
indexes <- rbind(ECG,DMG,FBG,FAG,MEG,ASG)
# ===========
max= val
min= valm
ui如果你查看ui,你会发现有一个逗号放错了位置。这似乎是一个语法错误。您确定在此过程的早期没有收到不同的错误消息吗?@MrFlick Thaanks!我完全忘了检查前面的错误消息。我发现我的“buttonLabel=“Seach”有一个问题,没有被使用。然后我还必须在侧边栏面板中包含“主面板”。现在很好,谢谢!
return(groups)
}
func(input$max,input$min)})
output$grouped <- renderTable({dataInput()}, spacing = 'xs', rownames= TRUE)
}
shinyApp(ui=ui,server=server)