모든 반짝이는 페이지에는 ui 및 server 요소가 있습니다. 문제는 사용자가 정의한 서버가 아니라 Ui가 아니라는 것입니다. 매우 기본적인 반짝이는 웹 페이지의 예는 아래를 참조하십시오.
library(shiny)
# setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) # set your working directory
# Set the ui section.
ui <- fluidPage(
h1("Title"),
selectInput("test.input", "Select a letter", choices = c("a", "b", "c")),
textOutput("test.output")
)
# Set the server section.
server <- function(input, output, session) {
output$test.output <- renderText(
paste0("You have selected ", input$test.input)
)
}
shinyApp(ui = ui, server = server)
이 반짝이 응용 프로그램에는 모두 기본 변수, 드롭 다운 메뉴 및 HTML 출력이 있으며, 모두 ui 변수에 정의되어 있습니다. 귀하의 페이지는 다음과 같아야합니다
가 반짝 응용 프로그램의 기본 레이아웃에 대한 이상 this page를 참조하십시오.