restructure: Restructure a named vector.

Description Usage Arguments Note Author(s) Examples

View source: R/restructure.R

Description

This function swaps vector elements with their names.

Usage

1
restructure(x) # where x is a named vector

Arguments

x

Note

Numerical values are converted to character.

Author(s)

Joost van de Weijer

Examples

1
2
3
4
5
(x=structure(1:3,names=letters[1:3]))
restructure(x)
restructure(x)
restructure(x)
# etc.

vdweijer/supply documentation built on June 28, 2021, 7:45 a.m.