r - Rshiny 中的错误:“没有默认值的参数丢失”
问题描述
我刚刚开始发现 Rshiny,在玩了一个星期后,我尝试创建一个地图,由于“selectizeInput”功能,我只能显示某些多边形......
由于下面的脚本,我认为我可以做到这一点,但实际上我收到了我无法解决的错误“没有默认值的参数丢失”!
有人可以告诉我我做错了什么吗?
ui <- dashboardPage(
dashboardHeader(title ="Draft_1"),
dashboardSidebar(
sidebarMenu(
menuItem("Map", tabName = "counties", icon = icon('info')),
)
),
dashboardBody(
tabItems(
tabItem(tabName = "counties",
fluidRow(selectizeInput("COUNTIES_ID", choices = shapefile1, selected="NONE"))
),
fluidRow(leafletOutput("map-test", height = 500)),
)))
server <- function(input, output){
updateSelectizeInput(session,
"COUNTIES_ID",
choices = shapefile1,
options = list(maxOptions = 1000),
selected = "45FDG)
output$map-test<-renderLeaflet(
leaflet(shapefile1) %>%
setView(1.45, 43.52, zoom = 12) %>%
addTiles() %>%
addPolygons(fillColor = "blue",
weight = 2,
opacity = 1,
color = "white",
dashArray = "3",
fillOpacity = 0.3,
highlight = highlightOptions(
weight = 5,
color = "#666",
dashArray = "",
fillOpacity = 0.7,
bringToFront = TRUE),
layerId = ~COUNTIES_ID)
)}
shinyApp(ui, server)
解决方案
删除,
末尾的:
sidebarMenu(
menuItem("Map", tabName = "counties", icon = icon('info')),
)
这,
使得sidebarMenu
期望另一个它没有找到的项目。
推荐阅读
- node.js - 如何在另一个项目中使用一个项目的现有猫鼬模式?
- android - 颤振构建apk错误
- python-3.x - Discord.py 替换用户昵称中的符号
- java - JAVA_HOME 设置不正确——Windows 10 上的 Hadoop
- airflow - Apache Airflow - 1.10 - 如何在运行期间访问 SQL 文件
- javascript - D3使用`line.defined()`时如何曲线段
- php - 使用动态下拉列表编辑表单时出错 - Cakephp
- nginx - ubuntu 20.04 上 minkube 中的跨命名空间通信
- python - 如何在 Chrome 的 Netwotk 选项卡检查中使用 *.php 在 Python 中抓取一些数据
- linux - printf - 打印 n 然后在下一行打印一个字符 n 次