Utility to convert named vector to two column tibble with first column being names of the vector and second being the vector

vector_to_tibble(vec, colname = "col")

Arguments

vec

A vector

colname

Name of the column to be formed

Value

A tibble

Details

The column containing names will be named 'names_colname'

Examples

vector_to_tibble(c(a = 1, b = 2), colname = "val")
#> # A tibble: 2 x 2 #> val_names val #> <chr> <dbl> #> 1 a 1 #> 2 b 2