1
나는 flexdashboard에 빛나는 런타임을 사용하고 있습니다.shiny에서 observeEvent를 사용하여 차트를 삭제하는 방법은 무엇입니까?
I 버튼을 눌러 (input$updt
)에 차트를 숨기 싶습니다, 나는이 시도했다 : 나는 그것을 숨기지 않습니다 버튼을 클릭 할 때, 그러나
---
title: "Students Data - College of Business"
output:
flexdashboard::flex_dashboard:
orientation: columns
runtime: shiny
---
```{r setup, include=FALSE}
library(flexdashboard)
library(ggplot2)
library(shinyjs)
shinyjs::useShinyjs(rmd=TRUE)
```
Column {data-width=650}
-----------------------------------------------------------------------
### Chart A
```{r}
actionButton('updt', 'Update chart')
output$p1 <-renderPlot({ ggplot(diamonds, aes(carat, price)) + geom_point() }, height=800)
plotOutput("p1")
output$p2 <- renderPlot({
ggplot(mtcars, aes(cyl, disp))+ geom_point()
})
plotOutput("p2")
observeEvent(input$updt, {hide("p1")})
```
을 p1
:
이해결 방법이
plotOutput
을 사용하는 것입니다 내가 다시 썼다 – Dambo을 기능 "숨기기"를 찾을 수 없습니다, 나는 내 대답을 편집 재현 할 수있는 예제를 사용하여 질문합니다 (미안하지만 처음부터 해 봤어야합니다). 그게 작동하지 않는 것 같아. – HubertL
그것은 shinyjs의 일부' – Dambo