0

In R markdown, I can set all my code as hidden using "code_folding: hide", suppose I want a specific code fragment to be shown by default e.g. {python code_folder='show'} . However that approach doesn't work.

Is there a way to do this?

Abhishek
  • 539
  • 5
  • 25
Sapsi
  • 711
  • 5
  • 16
  • add the argument `echo=TRUE`? – leerssej Nov 03 '17 at 04:29
  • @JensLeerssen unfortunately that doesnt work with python(or r) code blocks. – Sapsi Nov 03 '17 at 07:11
  • Confused. Does the following block hide your code and work for you? ```{r test_table, echo=FALSE} library(tidyverse) iris %>% group_by(Species) %>% summarise_if(is.numeric, funs(mean(.))) ``` – leerssej Nov 04 '17 at 01:01
  • If it does, then change your echo argument to `echo=TRUE` to see your code expressed. – leerssej Nov 04 '17 at 01:02
  • Skeptical. Does the following rmarkdown work for you? {r test_table, echo=FALSE} library(tidyverse) iris %>% group_by(Species) %>% summarise_if(is.numeric, funs(mean(.))) If it does work and it hides your code, then change your echo argument to `TRUE` to show your code. Or are truly not asking about showing code, and working on trying to build in JS buttons to fold and unfold code in your markdown docs (like the duplicate designation is assuming)? – leerssej Nov 04 '17 at 01:10

0 Answers0