tibble (version 1.3.4)

enframe: Converting atomic vectors to data frames, and vice versa

Description

enframe() converts named atomic vectors or lists to two-column data frames. For unnamed vectors, the natural sequence is used as name column.

deframe() converts two-column data frames to a named vector or list, using the first column as name and the second column as value.

Usage

enframe(x, name = "name", value = "value")

deframe(x)

Arguments

x

An atomic vector (for enframe()) or a data frame (for deframe())

name, value

Names of the columns that store the names and values

Value

A tibble

Examples

Run this code
# NOT RUN {
enframe(1:3)
enframe(c(a = 5, b = 7))
# }

Run the code above in your browser using DataCamp Workspace