We have chosen to show kable today because kable is minimal, but powerful. There are many different ways to produce tables in R. For more information on what kable can provide, see ?knitr::kable. There are other options that you can set in kable, but for these options will get you through a large majority of what you need. ![]() Some other useful features of kable include setting the rounding number, with the digits option.įor example, we could present the first 2 digits of each number like so: knitr :: kable(top_gap,Ĭaption = "The first 6 rows of the dataset, gapminder",ĭigits = 2) Table 8.2: The first 6 rows of the dataset, gapminder country knitr :: kable(top_gap,Ĭaption = "The first 6 rows of the dataset, gapminder") Table 8.1: The first 6 rows of the dataset, gapminder country Now, say that we wanted to include a caption? We use the caption argument. So how does that work? kable prints out the following: |country |continent | year| lifeExp| pop| gdpPercap| This gives us the following output top_gap <- head(gapminder) Kable takes a ame as input, and outputs the table into a markdown table, which will get rendered into the appropriate output format.įor example, let’s say we wanted to share the first 6 rows of our gapminder data. 20.1 How can I include a screenshot of an interactive graphic in PDF or Word?.19.2 How do I set options specific to each output.14.14 My Figure or Table isn’t being cited.14.13 I want to include inline R code verbatim to show an example.14.11 “The Legend of Link I”: Your images in !() don’t work.14.10 “Spolling II” Incorrectly spelled chunk option inputs.14.9 “Spolling I” Incorrectly spelled chunk options.14.8 “The Path Not Taken” File path incorrect.14.6 “Forgotten Trails II”: Chunk option with trailing ", or not input.14.4 “Not what I ordered”: Objects not created in the right order.14.3 “Duplication”: Duplicated chunk names. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |