2016-08-05 6 views
0

ドロップダウンがsidebarPanel - locationにあり、そこから最大2つのオプションを選択できます。ドロップダウンから 'サドルジョイント'と 'グライディングジョイント'をインチェイスして、別のsidebarPanel - datasetsでオブジェクト 'x'と 'y'を選択するifループを作成したいと思います。基本的にリンケージを作成します。SelectizeInput関数のためのサイドバーパネルを光沢のあるものにリンクする

私は、コードのこの部分を試してみましたが、それは動作しません:

if (input$location== "Saddle Joint" & input$location== "Gliding Joint") { 

    updateCheckboxGroupInput(session, 
          "datasets", "Datasets:", choices = c("x","y"), 
          selected= c("x","y")) 
} 

より良い映像のためのスクリーンショットを見てください!

ありがとうございます!

Screenshot

+0

さて、あなたの文は同時に '入力の$ location'ができない等しいハメ合同とグライディング合同以来、真なることはありません場合。 'input $ location'が複数の値を持つベクトルであれば、' '中括弧 '%を入力したい$ location&" "%in%input $ location" – Carl

+0

@Carl that works!ありがとうございました! – Harriss

+0

[OK]をクリックし、回答を提出します。 – Carl

答えて

0

問題は、あなたのif声明のbooleanしていました。これを使用します。

"Saddle Joint" %in% input$location & "Gliding Joint" %in% input$location 

も使用することができます

all(c("Saddle Joint","Gliding Joint") %in% input$location) 
関連する問題