randomizeCharacters: Replace Data with Random Character Strings

Description Usage Arguments Details Value Examples

View source: R/randomizeCharacters.R

Description

Replace Data with Random Character Strings

Usage

1
2
randomizeCharacters(x, cols = 1:ncol(x), randomizeNames = FALSE,
  consistent = TRUE, numChars = 10)

Arguments

x

a data.frame

cols

the columns that are to be replaced - may be numeric (column indices) or character (column names). If no value is given, all columns are replaced.

randomizeNames

whether or not column names should be randomized as well

consistent

whether or not reocurring values continue to hold the same value as each other after they are randomized

numChars

the number of characters the randomized data should contain

Details

Replaces all values within the specified columns with random 10-length character strings. By default, if a value reoccurs within the column, that value will be assigned the same random character string each time. Column names are also randomized. Both of these options may be changed.

Value

data.frame with with specified columns replaced by random strings

Examples

1
2
3
randomCharacters(data)
randomCharacters(data, 2, consistent=FALSE)
randomCharacters(data, c("Gender","Education"), randomizeNames=TRUE)

shuklak13/anonymizeR documentation built on May 29, 2019, 9:27 p.m.