Learn R Programming

rosetta (version 0.3.12)

randomSlug: Generate a random slug

Description

idSlug is a convenience function with swapped argument order.

Usage

randomSlug(x = 10, id = NULL, chars = c(letters, LETTERS, 0:9))

idSlug(id = NULL, x = 10, chars = c(letters, LETTERS, 0:9))

Value

A character value.

Arguments

x

Length of slug

id

If not NULL, prepended to slug (separated with a dash) as id; in that case, it's also braces and a hash is added.

chars

Characters to sample from

Examples

Run this code
randomSlug();
idSlug("identifier");

Run the code above in your browser using DataLab