Learn R Programming

berryFunctions (version 1.4)

nameSample: Nonrandom character sequence with sample

Description

Find the seed necessary to produce a character sequence by using sample Can especially impress newbies a lot.

Usage

nameSample(name)

Arguments

name
Character string. long strings (>>5) will compute a VERY long time!

Value

  • cats command into the console that can be copypasted to anyone's R script.

See Also

yearSample to wish a happy new year, set.seed, sample, letters

Examples

Run this code
nameSample("berry")
# After that, you can send the result to colleagues:
# Kind regards from
set.seed(1248272)
paste(sample(letters, 5, replace=TRUE), collapse='')

Run the code above in your browser using DataLab