laws_index: Index laws

View source: R/designs_helpers.R

laws_indexR Documentation

Index laws

Description

Index laws list according to desired class of law. This is an internal function which searches the laws of desired class in the lsit of laws. The classes should be obtained separately with a 'class_laws' function.

Usage

laws_index(experimental_design, type = "rand")

Arguments

experimental_design

Input object to test

type

Type (class) of the laws to be searched for. Multiple classes may be specified at the same time. This is an internal function which simplifies the treatment of different data generation procedures. Default value is "rand".

Value

Logic

Examples

# Create alternatives
alt1 <- alternative$new()
alt1$add_attributes(Quality = runif(min = 0, max = 1), Price = rnorm(mean = 5))
alt2 <- alternative$new()
alt2$add_attributes(Size = c(0, 1), Price = rnorm(mean = 6))

# Regroup alternatives into design
edesign <- experimental_design$new(alternatives = list(alt1, alt2))

# Get index list
index <- laws_index(edesign, type = c("rand"))

nikitagusarov/dcesimulatr documentation built on Jan. 7, 2023, 4:27 p.m.