seed_sample: A helper when creating seed-values

Description Usage Arguments Value

View source: R/seed_sample.R

Description

This function creates a vector with one or more seeds, which often will be needed in order to ensure that simulations done in parallel are reproducible. In addition some attributes will be added to document the random number generator used to obtain the values. See the help-page of Random for details about the three arguments kind, normal.kind and vstr.

Usage

1
2
seed_sample(n = 1, .seed = NULL, kind = NULL, normal.kind = NULL,
  vstr = NULL)

Arguments

n

An integer that specifies how many seeds that should be generated. The default value is 1.

.seed

An initial seed to be used to ensure reproducibility of the result from this function, and this value will be an attribute of the resulting vector. The default value for this argument is NULL, and when left unchanged a value will be sampled and used for this purpose.

kind

Character or NULL. If kind is a character string, set R's RNG to the kind desired.

normal.kind

Character string or NULL. If it is a character string, set the method of Normal generation.

vstr

A character string containing a version number of R. The default value NULL will use the present version number.

Value

A vector of seeds between the highest and lowest available integer, i.e. between -2147483647 and 2147483647 (the value used is the result of 2^31-1.) Attributes will be added in order to recreate the vector. NB: If n is given as 1, and .seed has been specified, then the returned value will be that value with the collection of attributes added to it.


LAJordanger/leanRcoding documentation built on Feb. 27, 2020, 4:42 p.m.