3.2 A Tibble as a Dataset
20220527 A tibble is a New Zealander’s pronunciation of table. It is an improved representation of a data frame.
A tibble can be created column-wise with named parameters to tibble::tibble().
## # A tibble: 5 × 3
## a b c
## <int> <int> <dbl>
## 1 11 7 11.2
## 2 12 3 11.9
## 3 13 13 9.57
## 4 14 7 9.74
## 5 15 12 8.24
An alternative and more readable form of the call to tibble::tibble() can be used.
tibble::tribble(
~date, ~item, ~amount,
"Jun 2019", "fixed", 99,
"Jun 2019", "consumed", 170,
"Jun 2019", "generated", 313,
"Sep 2019", "fixed", 97,
"Sep 2019", "consumed", 251,
"Sep 2019", "generated", 329)## # A tibble: 6 × 3
## date item amount
## <chr> <chr> <dbl>
## 1 Jun 2019 fixed 99
## 2 Jun 2019 consumed 170
## 3 Jun 2019 generated 313
## 4 Sep 2019 fixed 97
## 5 Sep 2019 consumed 251
## 6 Sep 2019 generated 329
If you find this curated material useful then you can consider a donation to support it's ongoing availability and give you access to the PDF version of this book. The material has been scoped up by Generative AI without permission or any kind of recompense so do consider a donation if you can afford it. Unlike Generative AI your access to this materials is freely given. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Togaware has a 30 year tradition of making popular open source software which includes sold privacy preserving productivity apps, rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0