6

I recently updated to R 3.5.0 and RStudio 1.1.453 and now my kable function is not working properly.

When I copy and paste the code and output, you see this:

library(knitr)
fakedata<-data.frame(Species = c(1:8), Sites = sample(1:25, 8, replace = TRUE), Positives = sample(1:100,8, replace=TRUE))
kable(fakedata)


| Species| Sites| Positives|
|-------:|-----:|---------:|
|       1|    22|        79|
|       2|    25|        97|
|       3|    19|        28|
|       4|    15|        22|
|       5|     9|        97|
|       6|    14|        71|
|       7|     1|        70|
|       8|    21|        83|

I get no error at all, and the output is the same with or without Rmarkdown. I also reinstalled MiKTeX.

When I knit it to a document the output is simply blank, again with no errors.

Is anyone else having this problem? Is there another update I am missing?

Thanks

Yihui Xie
  • 28,913
  • 23
  • 193
  • 419
P Motyka
  • 61
  • 3
  • There have been compatibility issues with knitting tables since R 3.5.0, documented on github for under both RMarkdown https://github.com/rstudio/rmarkdown/issues/1331 and RStudio https://github.com/rstudio/rstudio/issues/2748 – camille Jun 18 '18 at 23:59
  • You can try `kable(fakedata, format = "html")` as a work around if versioning is really the issue and reverting is not an option. – JMT2080AD Jun 19 '18 at 00:11
  • Thank you for those links @camille, I will know to look there next time. – P Motyka Jun 19 '18 at 00:23
  • And thanks @JMT2080AD, but it still outputs raw text. I am going to revert to the previous version. – P Motyka Jun 19 '18 at 00:23
  • @PMotyka Adding the `result='asis'` knit chunk option should do it with the raw html. I'm glad reversion is an option for you. – JMT2080AD Jun 19 '18 at 00:26
  • I cannot reproduce this with the preview version of RStudio. The question is not clear to me (due to the lack of a _self-contained_ example): I don't know what exactly you did with your example. Clicking the Knit button in RStudio? Clicking the Run button on the code chunk? What is your output format? And session info (`xfun::session_info('rmarkdown')`)? Too many unknown factors to answer your question. – Yihui Xie Jun 19 '18 at 19:58

1 Answers1

0

have you tried kable(format = "markdown") ?output

or kable(format = "html") enter image description here

landrower
  • 475
  • 6
  • 11