0
UI에서 SelectInput objet의 목록을 느낄 수 있도록 한 열의 데이터 프레임 행을 읽으려고했습니다. Shiny UI와 서버 사이의 전역 또는 로컬 참조에 문제가 있습니다. 형식은 하나의 열 (STEP_NAME) 내 DF Ref_comp 여기 selectInput 목록데이터 프레임 열의 SelectInput이있는 Shiny
수입 항목에 적합한 지 모르는 : 여기
! STEP_NAME !
-----------------
L1_2_3_LR
C46-C77-OTHERS
R4
R10
C56
Q4
L4
내 UI.R
shinyUI(pageWithSidebar(
headerPanel("My header Text"),
sidebarPanel(
radioButtons("test", "Select a DataBase",
c("test1"="test1",
"test2"="test2")),
textInput("card", "Enter the code card", "CARD.EX"),
textInput("comp", "Enter the ref comp", "R3"),
######## Here what I tried to do ########
selectInput("comp_sel","Component", choices=
as.character(unique(unlist(Ref_comp$STEP_NAME)))),
##########################################
downloadButton("plot_export", "Save PDF")
),
mainPanel(
#h4("Text2"),
library(plotly),
plotlyOutput("plot"))
))
여기
shinyServer(function(input,output){
output$plot <- renderPlotly({
con <- odbcConnect(con, uid="xxx")
##### Here the SQL Query to have my items ######################
sql_ref = paste("select DISTINCT ...") # My SQL query on distant server
###### Output in DF Ref_comp ##############
Ref_comp <- sqlQuery(db, paste (sql_ref))
##########################################
odbcClose(data_testeur)
#### An other SQL Query for the graph #######
graph <- ggplot(...
ggplotly(graph) # Print graph
}
)
})
여러분의 도움에 감사드립니다 내 Server.R
서버 코드에 쿼리가있는 데이터 프레임 개체가 Shiny UI에서 발견됩니까? 나는 범위 객체 간의 UI와 서버를 의미한다. –