plot.pltree {gosset} | R Documentation |
Get node labels and rules used in a party tree
Description
Returns the covariates used to split a recursive partitioning tree and the rules that were applied to build the tree
Usage
## S3 method for class 'pltree'
plot(x, log = TRUE, ref = NULL, ...)
## S3 method for class 'PlackettLuce'
plot(x, ...)
node_labels(x)
node_rules(x)
top_items(x, top = 5)
Arguments
x |
an object of class |
log |
logical, if |
ref |
optional, character or integer for the reference item when
log = |
... |
additional arguments passed to methods. See details |
top |
an integer for the number of items to return |
Details
multcomp = TRUE adds multi-comparison letters from multcompView ci.level = numeric for the confidence interval levels
Value
a vector with the node labels, a data.frame with node rules, a ggplot object
Author(s)
KauĂȘ de Sousa
Examples
library("PlackettLuce")
library("ggplot2")
data("beans", package = "PlackettLuce")
G = rank_tricot(data = beans,
items = c(1:3),
input = c(4:5),
group = TRUE,
additional.rank = beans[c(6:8)])
pld = cbind(G, beans[,c("maxTN", "season", "lon")])
tree = pltree(G ~ maxTN + season + lon, data = pld)
node_labels(tree)
node_rules(tree)
top_items(tree)
plot(tree)
plot(tree, log = FALSE)
#################################
# Plot PlackettLuce
R = matrix(c(1, 2, 4, 3,
4, 1, 2, 3,
2, 4, 1, 3,
1, 2, 3, 0,
2, 1, 4, 3,
1, 4, 3, 2), nrow = 6, byrow = TRUE)
colnames(R) = c("apple", "banana", "orange", "pear")
R = as.rankings(R)
mod = PlackettLuce(R)
plot(mod)
[Package gosset version 1.4 Index]