【发布时间】:2016-11-21 04:20:18
【问题描述】:
我正在尝试使用独特的功能来创建 selectInput 选项。但是,我的数据如下所示,这需要多个映射。例如,类似:
choices = c(`Pro Forma` = c('Pro-forma', 'ProForma', 'Proforma', 'Pro-Forma')`)
但不确定什么是正确的语法。
> unique(heatmap_raw$Status)
# [1] "Active" "Redeeming" "Proforma" NA "Pro-forma" "ProForma"
# [7] "na" "40act" "40 Act" "Pro-Forma" "40ACT" "UCITS"
selectInput("select month", label = ("Select Month"),
choices = c(unique(month(heatmap_raw$period))))
【问题讨论】:
-
您的问题真的是关于闪亮还是文本操作(如何使不同的标点符号解析为同一件事)?
-
@C8H10N4O2 感谢您的调查。我认为问题在于两者,因为我不确定在 Shiny 中传递多个标点符号的正确语法是什么。
choices = c(Pro Forma` = c('Pro-forma', 'ProForma', 'Proforma', 'Pro-Forma'))这种方式不起作用,因为它仍然在下拉菜单中创建了 4 个不同的选项,但是我只需要一个,所有四种类型的数据都会被选中。