我正在尝试创建一个交互式朝阳图,该图将根据多年的变化而变化,但是我一直遇到this错误。
数据集来自here。我已经对其进行了转换,以便可以在Sunburst库中以类似于this
的格式进行读取这是我的代码:
library(dplyr)
library(shiny)
library(sunburstR)
# Load Data
sun_tot <- read.csv("sunburst.csv", encoding = 'UTF-8')
sun_tot <- sun_tot[, c(1,2,3)]
# Define UI for application that creates a Sunburst Diagram
ui <- fluidPage(
titlePanel("Suicide Worldwide: Should you be worried"),
sidebarLayout(
sidebarPanel(sliderInput("YearInput", "Select year(s)",
min = 1985,
max = 2016,
value =c(1985:2016),sep = "")),
#uiOutput("Sun_colOutput"))
mainPanel(plotOutput("SunburstPlot"),
br(),
br(),
br(),
tableOutput("results"))
)
)
# Define server logic required to create a Sunburst Diagram
server <- function(input, output) {
output$SunburstPlot <- renderPlot({
sunburst(sun_tot[,c(2,3)],percent = FALSE, count = TRUE)
})
output$results <- renderTable({
sunburst_fil()
})
}
# Run the application
shinyApp(ui = ui, server = server)
不确定我缺少什么,我真的是使用光泽的新手。