Convert a vector into a 1-row data frame using the names of the vector as
column names for the data frame.
vector2df(x, nice_names = FALSE)
Arguments
- x
A vector.
- nice_names
A logical indicating whether names should be nicified.
Examples
vector2df(c(1, b = 2, `(Intercept)` = 3))
#> V1 b (Intercept)
#> 1 1 2 3
vector2df(c(1, b = 2, `(Intercept)` = 3), nice_names = TRUE)
#> V1 b Intercept
#> 1 1 2 3