Learn R Programming

tbltools (version 0.1.0)

as_tbl_data: as_tbl_data

Description

Converts data objects to tibbles.

Usage

as_tbl_data(x, row_names = FALSE)

Arguments

x

Data frame or data frame-like input.

row_names

Logical indicating whether to convert non-null row names into the first column.

Examples

Run this code
# NOT RUN {
## data with row names
d <- data.frame(x = rnorm(5), y = rnorm(5), row.names = letters[1:5])

## convert to tibble
as_tbl_data(d)

## convert to tibble and create row_names variable
as_tbl_data(d, row_names = TRUE)

# }

Run the code above in your browser using DataLab