setMissingNames {kimisc}R Documentation

Set the Missing Names in an Object

Description

This function is an enhanced version of setNames in the sense that the elements that already have names are not renamed.

Usage

setMissingNames(object, nm)

Arguments

object

an object for which a names attribute will be meaningful

nm

a character vector of names to assign to the object

Value

An object of the same sort as object with the new names assigned to the unnamed elements.

Author(s)

Hadley Wickham, Kirill Müller

References

http://stackoverflow.com/a/5043280/946850

See Also

setNames

Examples

setMissingNames(c(a=1, b=2, 3), letters[2:4])

[Package kimisc version 0.2-1 Index]