这是与问题相关的代码部分。我要完成的工作。在ui.R中,我试图根据选择的年份来限制用户可以选择的网站选择。我了解input.year不能正常工作,我仍然不熟悉光泽,也不十分确定如何从用户那里获得当前选择。
conditionalPanel(
condition = "input.plot != 'googlemaps'",
site1 <- selectInput(
inputId = "site1",
label = "Select a first site:",
choices = dbGetQuery(db, sprintf("SELECT DISTINCT site FROM 'so.mo' WHERE strftime('%%Y',datetime(datetime(date,'unixepoch'))) ='%s'",input.year))
)
),
selectInput(
inputId = "species",
label = "Species:",
choices = species_choices
),
conditionalPanel(
condition = "input.plot == 'calendar' || input.plot == 'timeVariation'",
selectInput(
inputId ="year",
label = "Year:",
choices = year_choices
)