View source: R/designs_helpers.R
check_attributes | R Documentation |
Verification that all desired characteristics are present in $Z$. This is an internal function which serves to simplify concatenation of multiple $Z$ when alternatives have different attributes.
check_attributes(Z, attributes)
Z |
Input data.frame Z |
attributes |
Desired vector of attributes to be present in Z. |
Z With missing attributes filled with NA's.
# 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 = runif(min = 0, max = 1), Price = rnorm(mean = 6)) # Regroup alternatives into design edesign <- experimental_design$new(alternatives = list(alt1, alt2)) Z <- designs_r(edesign, n = 1) # Querry object attr <- edesign$get_attributes() Z <- check_attributes(Z, attr)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.