Learn R Programming

DEXiR (version 1.0.2)

alt_values: alt_values

Description

Make a list of alternative's values corresponding to attributes.

Usage

alt_values(alt, attributes, as_character = TRUE, round = NULL)

Value

character(length(attributes)). String representation of alt's values.

Arguments

alt

data.frame representing a single alternative.

attributes

A vector of DexiAttribute objects.

as_character

logical(1).. Determines whether to represent alternative values numerically ("internal representation") (FALSE) or as character strings (using value_text()) (TRUE).

round

A single integer. An optional argument to value_text().

See Also

value_text()

Examples

Run this code
# Load "Car.dxi"
CarDxi <- system.file("extdata", "Car.dxi", package = "DEXiR")
Car <- read_dexi(CarDxi)

unlist(alt_values(Car$alternatives[1,], Car$attributes, as_character = TRUE))
# c("NULL", "exc", "low", "medium", "low", "exc", "high", "more", "4", "big", "high")

Run the code above in your browser using DataLab