## create a relation with a missing object
R <- ranking(1:2, 1:3)
print(R)
R <- as.relation(R)
## find all suitable completions within L
plot(relation_impute(R, method = "any/L", n = "all"))
## find 3 suitable partial orders
plot(relation_impute(R, method = "any/O", n = 3))
## compute average completion
R1 <- relation_impute(R, method = "average/O")
relation_incidence(R1)
## check correctness of averaging
R2 <- mean(relation_impute(R, "any/O", n = "all"))
stopifnot(all.equal(R1, R2))Run the code above in your browser using DataLab