Learn R Programming

DEXiR (version 1.0.2)

export_alternatives: export_alternatives

Description

Convert alternatives' data to a data frame formatted so that it can be imported by DEXi/DEXiWin software.

Usage

export_alternatives(model, alternatives = NULL)

Value

A data frame consisting of character strings that can be further written out by write_alternatives().

Arguments

model

A DexiModel object. Required.

alternatives

A data.frame of alternatives (normally an output of evaluate()) or indices to model$alternatives. The default value NULL selects model$alternatives.

Details

In order to import the output of export_alternative() in DEXi/DEXiWin software, proper Import/Export settings must be ensured in these programs:

DEXi

Option values: "base 1", Attributes: "all", Orientation: "normal", Indent: "indent".

DEXiWin

Option values: "Base 1", Attributes: "All", Orientation: "Attributes \ Alternatives", Indent: "Indent tree levels", CSV Format: "Invariant" when format = "csv" and "Local" when format = "csv2".

If alternatives contain value distributions, they can be imported only by DEXiWin and not by DEXi.

See Also

write_alternatives()

Examples

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

export_alternatives(Car)    # export both alternatives from Car
export_alternatives(Car, 1) # export only the first alternative

Run the code above in your browser using DataLab