2016-08-05 10 views
0

sidebarPanel - location에 드롭 다운이 있다고 가정하고 최대 2 개의 옵션을 선택할 수 있습니다. 드롭 다운에서 '안장 조인트'와 '글라이딩 조인트'를 인 클로닝하는 if 루프를 만들고 싶다면 sidebarPanel - datasets 오브젝트에서 'x'와 'y'를 선택하면됩니다. 기본적으로 연결을 만듭니다.SelectizeInput 함수에 대해 sidebarPanels을 반짝임으로 연결

나는이 코드 조각을 시도했지만 작동하지 않습니다 :

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'이 여러 값을 갖는 벡터 인 경우,''안장 조인트 "% in % input $ location &"글 랜드 조인트 "% input % location $ location' – Carl

+0

@Carl that works! 고맙습니다! – Harriss

+0

답변을 제출하십시오. – Carl

답변

0

문제는 if 문에서 부울로했다. 이 옵션을 사용합니다 :

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

은 또한 사용할 수 있습니다

all(c("Saddle Joint","Gliding Joint") %in% input$location)