1

Is there a way to insert tabulators in R markdown code? I just want to show sth. like

attendees:  33
sick leave:  1
presenters:  5

Text is Markdown text, numbers are inline R code. Simply putting spaces does not work, since there is a variably spaced font.

Ideally working for both HTML and PDF output. (I work on Win-10 in RStudio)

All my searches ended up in (a) creating markdown tables (too big), or (b) how to create tabs for tabbed browsing, much more complicated. I tried \t and \t, does not work.

Martin
  • 594
  • 5
  • 16
  • Is your showed example a text or a data.frame? – J_F Apr 21 '20 at 21:25
  • Text in markdown + numbers inserted by inline R code. Couldof course create a data.frame and print it by R code, but this looses the elegance of markdown. – Martin Apr 21 '20 at 21:35
  • 1
    Have you seen this post: https://stackoverflow.com/questions/9384746/is-it-possible-to-perform-tabs-in-multimarkdown – J_F Apr 21 '20 at 21:42
  • Thanks! No, I had missed that one. SInce Markdown does not support it, that's probably why I could not find an answer. (even if I do not concur with the concept of "sequencial data not designed for tabular output or v.v."). – Martin Apr 21 '20 at 22:28

1 Answers1

1

I use either the RStudio add-in BeautifyR which has a nice Beautify Table. Got the top banner under Tools there is the Add-ins button load BeautifyR.

Then there is also using Kable. Look for the R packages and install: knitr::kable and kableExtra.

mccurcio
  • 1,294
  • 5
  • 25
  • 44