Learn R Programming

DEXiR (version 1.0.2)

write_alternatives: write_alternatives

Description

Write out alternatives' data. First convert DEXi alternatives to a data frame using export_alternatives() and then write it to a file.

Usage

write_alternatives(
  model,
  alternatives = NULL,
  file = "",
  quote = FALSE,
  format = c("tab", "csv", "csv2"),
  ...
)

Value

Writes a "tab"- or "csv"-formatted alternatives' data to a file, console or clipboard. This data is meant to be subsequently imported to 'DEXi' software.

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.

file

Write the data frame contents to a file. When file = "", the contents is written to the console (default). file = "clipboard" might also work to copy the contents to the clipboard.

quote

logical(1). Whether or not to quote output character strings.

format

One of "tab", "csv" or "csv2" to invoke write.table(), write.csv() or write.csv2(), respectively.

...

Optional parameters to write.table() functions.

See Also

export_alternatives(), write.table()

Examples

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

# Write both Car alternatives to console
write_alternatives(Car, file = "")

Run the code above in your browser using DataLab