Learn R Programming

⚠️There's a newer version (3.2.1) of this package.Take me there.

tibble

Overview

A tibble, or tbl_df, is a modern reimagining of the data.frame, keeping what time has proven to be effective, and throwing out what is not. Tibbles are data.frames that are lazy and surly: they do less (i.e. they don’t change variable names or types, and don’t do partial matching) and complain more (e.g. when a variable does not exist). This forces you to confront problems earlier, typically leading to cleaner, more expressive code. Tibbles also have an enhanced print() method which makes them easier to use with large datasets containing complex objects.

If you are new to tibbles, the best place to start is the tibbles chapter in R for data science.

Installation

Usage

Create a tibble from an existing object with as_tibble():

This will work for reasonable inputs that are already data.frames, lists, matrices, or tables.

You can also create a new tibble from column vectors with tibble():

tibble() does much less than data.frame(): it never changes the type of the inputs (e.g. it never converts strings to factors!), it never changes the names of variables, it only recycles inputs of length 1, and it never creates row.names(). You can read more about these features in the vignette, vignette("tibble", package = "tibble").

You can define a tibble row-by-row with tribble():

Related work

The tibble print method draws inspiration from data.table, and frame. Like data.table::data.table(), tibble() doesn’t coerce strings to factors by default, doesn’t change column names, and doesn’t use rownames.


Code of Conduct

Please note that the tibble project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Copy Link

Version

Install

install.packages('tibble')

Monthly Downloads

1,612,069

Version

3.0.6

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

January 29th, 2021

Functions in tibble (3.0.6)

is.tibble

Deprecated test for tibble-ness
is_tibble

Test if the object is a tibble
add_row

Add rows to a data frame
frame_matrix

Row-wise matrix creation
add_column

Add columns to a data frame
glimpse

Get a glimpse of your data
as_tibble

Coerce lists, matrices, and more to data frames
enframe

Converting vectors to data frames, and vice versa
deprecated

Deprecated functions
new_tibble

Tibble constructor and validator
view

View an object
reexports

Objects exported from other packages
tribble

Row-wise tibble creation
knit_print.trunc_mat

knit_print method for trunc mat
name-repair-superseded

Superseded functions for name repair
name-repair

Name repair
subsetting

Subsetting tibbles
rownames

Tools for working with row names
tibble

Build a data frame
tibble-package

tibble: Simple Data Frames
lst

Build a list
tbl_df-class

tbl_df class
formatting

Printing tibbles
tbl_sum

Provide a succinct summary of an object