0

I am starting to write a simple book using Bookdown. I note that tables and figures can be generated using Knitr. However, I'm struggling to see where the data for a table or a figure is stored.

The example provided at: https://bookdown.org/yihui/bookdown/ uses the following code:

```{r nice-tab, tidy=FALSE}
knitr::kable(
  head(iris, 20), caption = 'Here is a nice table!',
  booktabs = TRUE
)
```

However, I don't see a file containing the data for the 'nice' table among the files that are part of the package (or, similarly, the images that are used for figures).

I'd appreciate anybody who could point me in the right direction please.

Yihui Xie
  • 28,913
  • 23
  • 193
  • 419
Poul
  • 5
  • 4
  • Are you asking about the `iris` dataset being used here? It's included as a toy example in R. – Greg Aug 05 '20 at 17:33
  • Thanks @Greg, so if iris is included with R, then presumably if you want to add your own dataset, this has to be included as one of the files? – Poul Aug 06 '20 at 08:22
  • I'm not quite sure what you mean by "as one of the files". You can certainly add your own dataset. Just make (or import, or whatever) a dataframe and place the name of that dataframe where `iris` is now. – Greg Aug 06 '20 at 12:28
  • Sorry @Greg, by 'as one of the files' I meant one of the files within the folder for the book in question. I think you've answered my question though - I couldn't find the iris dataset as one of the files because it comes as standard with R. – Poul Aug 06 '20 at 19:21

0 Answers0