nv2df: Create a data frame from a named vector

View source: R/convert.R

nv2dfR Documentation

Create a data frame from a named vector

Description

This function simply takes the values of the input vector and assigns it to the first column of the dataframe. The second column assigned from the names of this input vectors)

Usage

nv2df(x, clmn.names=c('x','name'), ...)

Arguments

x

a named vector

clmn.names

a vector of names of the new columns formed by 1) the values and 2) the names of the named vector

...

other parameters passed on to data.frame()

Value

a two column dataframe with values of x in the first column and the names of x in the second

Author(s)

David Schruth

See Also

vector,name

Examples


x <- 1:3
nv2df(nv(x,letters[x]), clmn.names=c('x','y'))


caroline documentation built on July 6, 2026, 9:07 a.m.