Tidy up a hyper2 object by removing players about which we have no information

tidy(H)

Arguments

H

A hyper2 object

Details

Function tidy(H) returns a hyper2 object mathematically identical to H but with unused players (that is, players that do not appear in any bracket) removed. Players about which H is uninformative are removed from the pnames attribute.

Note that idiom pnames(H) <- foo can also be used to manipulate the pnames attribute.

Author

Robin K. S. Hankin

Examples



H <- hyper2(pnames=letters)
H["a"] <- 1
H["b"] <- 2
H[c("a","b")] <- -3

pnames(H)
#>  [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s"
#> [20] "t" "u" "v" "w" "x" "y" "z"
pnames(tidy(H))
#> [1] "a" "b"

H == tidy(H)  # should be TRUE
#> [1] TRUE