setStrings: setStrings

Description Usage Arguments See Also Examples

Description

Method used to create REARandom object that will be passed in API call to Random.org's generateStrings method.

Usage

1
2
3
4
5
6
  ## S4 method for signature 
## 'REARandom,numeric,numeric,numeric,character,logical'
setStrings(REARandomObject,
  id = 42, n = 1, length = 1, characters = c(letters, LETTERS, c(0:9),
  "!", "@", "#", "$", "%", "^", "&", "-", ",", "?", "|", ":", ";", "<", ">",
  ",", ".", "_"), replacement = FALSE)

Arguments

REARandomObject

an Object of class REARandom to prepare for generateStrings API call

id

An ID number used to match response to request. Defaults to 42.

n

The number of random values to return must be in [1, 1e4]

length

The number of characters to include in each random string (must be in [1, 20])

characters

The set of characters from which to generate random strings. Must have length <= 80.

replacement

Should numbers be sampled with or without replacement. Default is FALSE (e.g., unique values).

See Also

Other REARandom Constructor Methods: setApiKey, setBLOBs,REARandom,numeric,numeric,numeric,character-method, setDecimals,REARandom,numeric,numeric,numeric,logical-method, setIntegers,REARandom,numeric,numeric,numeric,numeric,logical,numeric-method, setNormal,REARandom,numeric,numeric,numeric,numeric,numeric-method, setUniqueID,REARandom,numeric,numeric-method

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 

# Create a new REARandom object
myNewReaRandomObject <- reaRandom() %>%
						   setStrings(id = 37,
						   			  n = 12,
						   			  characters = myChars,
						   			  replacement = FALSE)

# Create object with characters to use in method call
myChars <- c(letters, LETTERS, c(0:9), "!", "@", "#", "$", "%", "^",
					"&", "-", ",", "?", "|", ":", ";", "<", ">", ",", ".", "_")


## End(Not run)

wbuchanan/reaRandom documentation built on May 4, 2019, 2:01 a.m.