Learn R Programming

mosaicCore (version 0.9.4.0)

vector2df: Convert a vector to a data frame

Description

Convert a vector into a 1-row data frame using the names of the vector as column names for the data frame.

Usage

vector2df(x, nice_names = FALSE)

Value

A data frame.

Arguments

x

A vector.

nice_names

A logical indicating whether names should be nicified.

Examples

Run this code
vector2df(c(1, b = 2, `(Intercept)` = 3))
vector2df(c(1, b = 2, `(Intercept)` = 3), nice_names = TRUE)

Run the code above in your browser using DataLab