# NOT RUN {
# rankings
R <- matrix(c(1, 2, 0, 0,
4, 1, 2, 3,
2, 1, 1, 1,
1, 2, 3, 0,
2, 1, 1, 0,
1, 0, 3, 2), nrow = 6, byrow = TRUE)
colnames(R) <- c("apple", "banana", "orange", "pear")
R <- as.rankings(R)
# group rankings into two groups
G <- group(R, rep(1:2, 3))
# plfit() gives the same results as PlackettLuce()
pl <- plfit(G)
pl$coefficients
-pl$objfun
mod <- PlackettLuce(R)
coef(mod)
logLik(mod)
# }
Run the code above in your browser using DataCamp Workspace