Learn R Programming

crossmap (version 0.3.0)

autonames: Automatically generate names for vectors

Description

Automatically generate names for vectors

Usage

autonames(x, ..., trimws = TRUE)

Value

Returns the names of a named vector and the elements of an unnamed vector formatted as characters.

Arguments

x

A vector

...

Additional arguments passed to format()

trimws

Whether to trim whitespace surrounding automatically formatted names. Defaults to TRUE.

Examples

Run this code
autonames(c(a = "apple", b = "banana", c = "cantaloupe"))
autonames(c("apple", "banana", "cantaloupe"))

autonames(10^(1:4))
autonames(10^(1:4), big.mark = ",")
autonames(10^(1:4), scientific = TRUE)

Run the code above in your browser using DataLab