2
我可以在Shiny的選擇輸入上創建多個級別的數組嗎?我怎樣才能實現它?R Shiny - 如何在選擇輸入中創建多個級別的數組?
這是代碼我在我的ui.R
,
# Site 1 options.
selectInput(
inputId = "site1",
label = "Select a first site:",
choices = siteChoices
),
# Site 2 options.
selectInput(
inputId = "site2",
label = "Select a second site:",
choices = c('None', siteChoices)
),
它創建這個網站,
<select id="site1">
<option value="9" selected>9 - Wood Shed</option>
<option value="13">13 - V.V.</option>
<option value="18">18 - Meryls House</option>
</select>
<select id="site2">
<option value="None" selected>None</option>
<option value="13">13 - V.V.</option>
<option value="18">18 - Meryls House</option>
</select>
但我想,而不是創建此,
<select id="site1" name="sites[site1]">
<option value="9" selected>9 - Wood Shed</option>
<option value="13">13 - V.V.</option>
<option value="18">18 - Meryls House</option>
</select>
<select id="site2" name="sites[site2]">
<option value="None" selected>None</option>
<option value="13">13 - V.V.</option>
<option value="18">18 - Meryls House</option>
</select>
是它可能?