'knitr::kable outputs code instead of a pretty table

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



Solution 1:[1]

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

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 landrower