rand_str: Generate Random Strings

Description Usage Arguments Examples

View source: R/generate_user_ids.R

Description

Generate n random strings of any length using a combination of uppercase or lowercase letters and digits 0-9.

Usage

1
2
3
4
5
6
7
8
rand_str(
  n = 10,
  length = 6,
  digits = TRUE,
  upperalpha = TRUE,
  loweralpha = TRUE,
  unique = TRUE
)

Arguments

n

Number of strings

length

Length of strings

digits

Logical: TRUE and digits will be in string, FALSE and they won't.

upperalpha

Logical: TRUE and capital letters will be in string, FALSE and they won't.

loweralpha

Logical: TRUE and lowercase will be in string, FALSE and they won't.

unique

Logical: TRUE and strings will be unique, FALSE and they won't.

Examples

1
user_ids <- data.frame(id = rand_str(n = 50))

jdtrat/taskdesignr documentation built on Feb. 4, 2021, 9:48 p.m.