Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 应用conditionalPanel逻辑,其中一个switchInput设置为TRUE,滑块具有不同的输入_Javascript_R_Shiny_Shinyjs_Shiny Reactivity - Fatal编程技术网

Javascript 应用conditionalPanel逻辑,其中一个switchInput设置为TRUE,滑块具有不同的输入

Javascript 应用conditionalPanel逻辑,其中一个switchInput设置为TRUE,滑块具有不同的输入,javascript,r,shiny,shinyjs,shiny-reactivity,Javascript,R,Shiny,Shinyjs,Shiny Reactivity,我正在实现一个R闪亮的应用程序,我的Javascript技能不强 我正在努力想出条件面板中的条件逻辑。如果id1设置为TRUE,并且滑块范围id2有不同的选择,如何仅显示id3 library(shiny) library(shinyWidgets) ui <- fluidPage( materialSwitch(inputId = "id1", label = "Do I want this on?", value = FALSE, status = "primary"), s

我正在实现一个R闪亮的应用程序,我的Javascript技能不强

我正在努力想出条件面板中的条件逻辑。如果id1设置为TRUE,并且滑块范围id2有不同的选择,如何仅显示id3

library(shiny)
library(shinyWidgets)

ui <- fluidPage(
  materialSwitch(inputId = "id1", label = "Do I want this on?", value = FALSE, status = "primary"),
  sliderTextInput(inputId = "id2", label = "Show below if the range is greater than 0", choices = 2000:2018, selected = rep(2018, 2)),
  br(), br(),
  conditionalPanel("input.id1 && input.id2[1] != input.id2[2]",
               materialSwitch(inputId = "id3", label = "To show based on conditions above.", value = FALSE, status = "primary")
  )
)

server <- function(input, output) {}

shinyApp(ui = ui, server = server)

我忘了Javascript使用零基索引,不像R

library(shiny)
library(shinyWidgets)

ui <- fluidPage(
  materialSwitch(inputId = "id1", label = "Do I want this on?", value = FALSE, status = "primary"),
  sliderTextInput(inputId = "id2", label = "Show below if the range is greater than 0", choices = 2000:2018, selected = rep(2018, 2)),
  br(), br(),
  conditionalPanel("input.id1 && input.id2[0] != input.id2[1]",
           materialSwitch(inputId = "id3", label = "To show based on conditions above.", value = FALSE, status = "primary")
  )
)

server <- function(input, output) {}

shinyApp(ui = ui, server = server)

它是'input.id1&input.id2[1]!=input.ids[2]”故意的还是要在此处使用&&呢?不是故意的,只是试图找到解决方案。要检查和条件,应使用&&确定。任何一种方法都不能解决问题。input.id1&&input.id2.value!=input.id1.value?
library(shiny)
library(shinyWidgets)

ui <- fluidPage(
  materialSwitch(inputId = "id1", label = "Do I want this on?", value = FALSE, status = "primary"),
  sliderTextInput(inputId = "id2", label = "Show below if the range is greater than 0", choices = 2000:2018, selected = rep(2018, 2)),
  br(), br(),
  conditionalPanel("input.id1 && input.id2[0] != input.id2[1]",
           materialSwitch(inputId = "id3", label = "To show based on conditions above.", value = FALSE, status = "primary")
  )
)

server <- function(input, output) {}

shinyApp(ui = ui, server = server)