| recodeDoe | R Documentation |
Re-code the levels in a design of experiment
recodeDoe(doe, levels)
doe |
A design of experiment data frame. Each row is an alternative, each column is an attribute. |
levels |
A named list of vectors defining each attribute (the names)
and each level for each attribute (the vectors). For example, a design
with two attributes, "price" and "type", that each had three levels should
be defined as |
Returns a re-coded design of experiment using the labels in the
levels argument.
# Define the attributes and levels
levels <- list(
price = seq(1, 4, 0.5), # $ per pound
type = c('Fuji', 'Gala', 'Honeycrisp', 'Pink Lady', 'Red Delicious'),
freshness = c('Excellent', 'Average', 'Poor')
)
# Make a full-factorial design of experiment
doe <- makeDoe(levels)
# Re-code levels
doe <- recodeDoe(doe, levels)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.