bind_vector: Column Bind an Atomic Vector's Values with Its Names

Description Usage Arguments Value Examples

View source: R/bind_vector.R

Description

Deprecated, use tidy_vector instead.

Usage

1
bind_vector(x, id.name = "id", content.name = "content", ...)

Arguments

x

A named atomic vector.

id.name

The name to use for the column created from the vector names.

content.name

The name to use for the column created from the vector values.

...

ignored.

Value

Returns a data.table with the names from the vector as an id column.

Examples

1
2
3
4
5
## Not run: 
x <- setNames(sample(LETTERS[1:6], 1000, TRUE), sample(state.name[1:5], 1000, TRUE))
bind_vector(x)

## End(Not run)

Example output

              id content
   1: California       C
   2: California       E
   3:   Arkansas       D
   4:     Alaska       B
   5:    Alabama       C
  ---                   
 996: California       E
 997:     Alaska       A
 998:   Arkansas       D
 999:   Arkansas       F
1000:     Alaska       B
Warning message:
Deprecated, use textshape::tidy_vector() instead. 

textshape documentation built on May 29, 2021, 1:07 a.m.