enframe

0th

Percentile

Convert a Named Vector Into A data.table

Returns a data.table::data.table() with two columns: The names of x (or seq_along(x) if unnamed) and the values of x.

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

:: vector() Vector to convert to a data.table::data.table().

name

:: character(1) Name for the first column with names.

value

:: character(1) Name for the second column with values.

Value

data.table::data.table().

Aliases
  • enframe
Examples
# NOT RUN {
x = 1:3
enframe(x)

x = set_names(1:3, letters[1:3])
enframe(x, value = "x_values")
# }
Documentation reproduced from package mlr3misc, version 0.1.0, License: LGPL-3

Community examples

Looks like there are no examples yet.