if (requireNamespace("GGally", quietly = TRUE)) {
# Load "Car.dxi"
CarDxi <- system.file("extdata", "Car.dxi", package = "DEXiR")
Car <- read_dexi(CarDxi)
# Plot all Car$alternatives with points and lines
plotalt_parallel(Car)
# Show alternatives on two separate chart segments, shown one above the other.
plotalt_parallel(Car, split = "v")
alts3 <- structure(
list(
name = c("MyCar", "MyCar2", "MyCar1b"),
CAR.1 = list(4L, 4L, c(1L, 4L)),
PRICE = list(3L, 3L, c(1L, 3L)),
BUY.PRICE = list(3L, 3L, 3L),
MAINT.PRICE = list(2, 1, structure(c(0.1, 0.6, 0.3), class = "distribution")),
TECH.CHAR. = list(3L, 3:4, 3L),
COMFORT = list(3L, 2, 3L),
X.PERS = list(3, 3, 3L),
X.DOORS = list(3, 3, 3L),
LUGGAGE = list(2L, 2L, 2),
SAFETY = list(2, c(2, 3), 2)
),
row.names = c(NA, -3L),
class = "data.frame"
)
# Plot `alts2` with points and lines.
# Notice the "minmax" aggregation of sets and distributions.
plotalt_parallel(Car, alts3)
plotalt_parallel(Car, alts3, split = "v")
# Now with "mean" aggregation
plotalt_parallel(Car, alts3, split = "v", aggregate = "mean")
}
Run the code above in your browser using DataLab