I am getting this error when trying to run shiny application.
Error in xj[i] : invalid subscript type 'closure'
following are ui.R and server.R files.
ui.R
=========
visit = read.csv("lookuptable.csv",head=T) # reading table
shinyUI(pageWithSidebar(
headerPanel('Disease Risk Prediction'),
sidebarPanel(
selectInput("patient",
label = "Patient",
choices = as.character(visit[,1]),
selected = as.character(visit[1,1]),multiple = FALSE)
),
mainPanel(
plotOutput("plot1") # plot bubble chart
)
))
server.R
==========
library(shiny)
shinyServer(
function(input, output) {
visit <- read.csv("lookuptable.csv",head=T)
visit <- visit[1:39,1:22]
ind <- reactive({which(visit[,1]%in%input$patient)})
prob <- reactive({as.numeric(visit[ind,c("prob1","prob2","prob3","prob4","prob5")])})
time <- reactive({as.numeric(visit[ind,c("time1","time2","time3","time4","time5")])})
icd <- reactive({visit[ind,c("icd1","icd2","icd3","icd4","icd5")]})
icd <- reactive({apply(icd,2,as.character)})
출력 $ plot1 < -renderPlot (심볼 (시간(), PROB(), 원 = PROB(), 인치 = 0.5, FG = " 어떤 도움에 감사드립니다오류 [I] : 잘못된 첨자 형 '폐쇄'
}
)
흰색 ", BG ="빨간색 ")) # 플롯 버블 차트. 당신은 당신이 적절하게 호출 할 필요가 있다는 것을 의미 ind
반응성 기능을 정의한 사전 Shivang
아아,이 포스트는 오류 텍스트의 상단 구글 결과이지만,이다 형식이 잘못되어 "주로 코드"오류로 인해 편집 할 수 없습니다. – Dragomok