R Tibble

Tibbles are a re-engineered data frame. They are available from the tibble package.


Installation

The tibble package is commonly used through Tidyverse.


Usage

A tibble is instantiated like:

> t1 <- tibble(foo = c(1,2,4),
               bar = c("a","b","c"),
               constant10 = 10)

> t2 <- as_tibble(data.frame(foo = c(1,2,4),
                             bar = c("a","b","c"))

> t3 <- as_tibble(matrix(1:9, nrow=3))

> t4 <- as_tibble(matrix(1:9, nrow=3), .name_repair="universal")

> t5 <- as_tibble(matrix(1:9, nrow=3), rownames="casenum", .name_repair="universal")

In comparison to data frames:

Note that tibbles store each column separately, and that tibbles instantiate the columns sequentially. It is possible to declare a column as a function of prior columns.

Tibbles are multiclassed as both data.frame and tbl_df.


CategoryRicottone

R/Tibble (last edited 2026-05-07 12:57:27 by DominicRicottone)