Learn R Programming

caroline (version 0.3-6)

nv: Create a named vector from a dataframe, table or vector

Description

The '$' or "[," operators for dataframes and tables do not carry along with them the row names. This function provides a solution for this problem. Optionally, you can pass a vector to x and use name to name it (great for default parameters)

Usage

nv(x, name)

Arguments

x
The source dataframe, table, or vector
name
The column name you would like to pull out as a named vector. OR the names of the vector (if x is a vector)

See Also

$