我正在遵循以下说明:
https://rstudio.github.io/shinydashboard/appearance.html
但是我得到了这个错误:
Warning: Error in $: $ operator is invalid for atomic vectors
55: dots_list
54: tags$section
51: dashboardSidebar这是我的代码:
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(
# Custom CSS to hide the default logout panel
tags$head(tags$style(HTML('.shiny-server-account { display: none; }'))),
# The dynamically-generated user panel
uiOutput("userpanel")
),
dashboardBody()
)
server <- function(input, output, session) {
output$userpanel <- renderUI({
# session$user is non-NULL only in authenticated sessions
if (!is.null(session$user)) {
sidebarUserPanel(
span("Logged in as ", session$user),
subtitle = a(icon("sign-out"), "Logout", href="__logout__"))
}
})
}
shinyApp(ui, server)就像说明书上说的那样。错误在此行中
tags$head(tags$style(HTML('.shiny-server-account { display: none; }'))),因为如果我把它取出来,误差就消失了。
我有类似的代码工作了很长一段时间,但它突然停止了工作。任何帮助都是非常感谢的。
发布于 2019-11-15 09:24:34
在我重新安装Rstudio之后,这个问题就消失了。我不知道为什么。
https://stackoverflow.com/questions/58868379
复制相似问题