Learn R Programming

DEXiR (version 1.0.2)

attribute_effect: attribute_effect

Description

Given a single alternative, determine the effects of varying attribute on target attribute.

Usage

attribute_effect(model, attribute, alternative, target = NULL, seq = NULL, ...)

Value

A list of target evaluation results, indexed by the values of seq.

Arguments

model

A DexiModel object. Required.

attribute

A DexiAttribute with assigned discrete or continuous scale.

alternative

A data.frame containing a single alternative.

target

Target DexiAttribute. Defaults to model$first().

seq

A sequence of attribute's numeric values for which to evaluate alternative. For discrete scales: Must be a sequence of integers. Defaults to attribute$scale$full_range(). For continuous scales: seq is required.

...

Optional parameters passed to evaluate_attribute().

See Also

evaluate_attribute()

Examples

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

alt <- Car$alternative("MyCar",
         BUY.PRICE="low", MAINT.PRICE=2, X.PERS="more", X.DOORS="4", LUGGAGE=2, SAFETY="medium")
# Determine the effect of changing "SAFETY" balues on "CAR.1"
attribute_effect(Car, "SAFETY", alt)
# Returns a list of "CAR.1" values corresponding to consecutive values of "SAFETY"
attribute_effect(Car, "LUGGAGE", alt, "TECH.CHAR.")
# Returns a list of "TECH.CHAR." values corresponding to consecutive values of "LUGGAGE"

Run the code above in your browser using DataLab