Closed RobinHankin closed 9 months ago
Function ordervec2supp()
is not vectorised, so:
library("hyper2")
#> Loading required package: magrittr
#> Loading required package: cubature
library("prefmod")
#> Loading required package: gnm
#> Loading required package: colorspace
#>
#> Attaching package: 'prefmod'
#> The following objects are masked from 'package:hyper2':
#>
#> baseball, tennis
x <- as.matrix(salad)
head(x)
#> A B C D
#> [1,] 1 2 3 4
#> [2,] 1 2 3 4
#> [3,] 2 1 3 4
#> [4,] 2 1 4 3
#> [5,] 2 1 4 3
#> [6,] 2 3 1 4
H <- hyper2()
for(i in seq_len(nrow(x))){H <- H + ordervec2supp(x[i,])}
H
#> log(A^10 * (A + B)^-3 * (A + B + C)^-2 * (A + B + C + D)^-32 * (A + B +
#> D)^-5 * (A + C)^-7 * (A + C + D)^-23 * (A + D)^-16 * B^31 * (B + C +
#> D)^-2 * (B + D)^-1 * C^29 * (C + D)^-5 * D^26)
Created on 2023-06-23 with reprex v2.0.2
See inst/salad.Rmd
It would be nice to include the
salad
dataset from theprefmod
package in the examples.