RMarkdown collapsible panel

后端 未结 3 1175
梦谈多话
梦谈多话 2021-02-03 12:52

As I am preparing tutorials for students, I need a way to hide content in collapsible panels which can be revealed by clicking on a button. I have got this to work using the cod

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-03 13:20

    Another simple solution that would work (but without buttons and styling).

    ```{r, eval=FALSE}
    hist(1:10)
    ```
    
    
    Click for Answer ```{r, echo=FALSE, eval=TRUE} hist(1:10) ```

    And here are the two states:

    Collapsed

    Expanded

提交回复
热议问题