0

I have created data frames in r markdown but they will not print or display in the output. The data frames are in the global environment, and the data are correct. However, instead of displaying the results, markdown is printing all NAs and 0 rows messages.

How do I get the actual data frame to print?

JoE
  • 1
  • 1
  • 1
  • 2
  • 3
    Welcome to SO. Please read up on [ask] and [how to create a reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) and edit your question accordingly. – Heroka Sep 28 '15 at 11:22
  • 1
    How are you knitting the Rmd? If it's with RStudio's "Knit" button, it creates a new environment for knitr (i.e. it has no idea what's in your global env). – hrbrmstr Sep 28 '15 at 12:20

1 Answers1

3

You can via the knitr package, invoke the kable's function; A simple example: Assuming that your data frame is mtcars:

```{r comment='', echo=FALSE, results='asis'}
 knitr::kable(mtcars[1:5,], caption = "A Knitr table.", floating.environment="sidewaystable")
```
freestyle
  • 67
  • 8