designUniformRandom: Uniform Design Generator

View source: R/designUniformRandom.R

designUniformRandomR Documentation

Uniform Design Generator

Description

Create a simple experimental design based on uniform random sampling.

Usage

designUniformRandom(x = NULL, lower, upper, control = list())

Arguments

x

optional data.frame x to be part of the design

lower

vector with lower boundary of the design variables (in case of categorical parameters, please map the respective factor to a set of contiguous integers, e.g., with lower = 1 and upper = number of levels)

upper

vector with upper boundary of the design variables (in case of categorical parameters, please map the respective factor to a set of contiguous integers, e.g., with lower = 1 and upper = number of levels)

control

list of controls:
size number of design points
types this specifies the data type for each design parameter, as a vector of either "numeric","integer","factor". (here, this only affects rounding)
replicates integer for replications of each design point. E.g., if replications is two, every design point will occur twice in the resulting matrix.

Value

matrix design
- design has length(lower) columns and (size + nrow(x))*control$replicates rows. All values should be within lower <= design <= upper

Examples

set.seed(1) #set RNG seed to make examples reproducible
design <- designUniformRandom(,1,2) #simple, 1-D case
design
design <- designUniformRandom(,1,2,control=list(replicates=3)) #with replications
design
design <- designUniformRandom(,c(-1,-2,1,0),c(1,4,9,1),
		control=list(size=5, types=c("numeric","integer","factor","factor")))
design
x <- designUniformRandom(,c(1,-10),c(2,10),control=list(size=5))
x2 <- designUniformRandom(x,c(1,-10),c(2,10),control=list(size=5))
plot(x2)
points(x, pch=19)

SPOT documentation built on June 26, 2022, 1:06 a.m.