psubs.Rd
Given a hyper2 object, substitute some players
psubs(H, from, to)
psubs_single(H, from, to)
Function psubs()
substitutes one or more player names, replacing
player from[i]
with to[i]
. If argument to
is
missing, all players are substituted, the second argument taken to be
the replacement: interpret psubs(H,vec)
as
psubs(H,from=pnames(H),to=vec)
.
Compare pnames<-()
, which can only add players, or reorder
existing players.
Function psubs_single()
is a low-level helper function that takes
a single player and its substitute; it is not intended for direct use.
Returns a hyper2 object
psubs(icons,c("L","NB"),c("London","Norfolk Broads"))
#> log(London^24 * (London + Norfolk Broads + OA + THC)^-20 * (London +
#> Norfolk Broads + OA + WAIS)^-9 * (London + Norfolk Broads + THC +
#> WAIS)^-15 * (London + OA + PB + THC)^-11 * (London + OA + PB +
#> WAIS)^-18 * (London + PB + THC + WAIS)^-16 * Norfolk Broads^32 *
#> (Norfolk Broads + OA + PB + THC)^-18 * (Norfolk Broads + OA + PB +
#> WAIS)^-8 * (Norfolk Broads + PB + THC + WAIS)^-18 * OA^14 * PB^30 *
#> THC^24 * WAIS^9)
rhyper2() |> psubs(letters,LETTERS) # ignore i,j,k,...,z
#> log(A^5 * (A + B + C + D + E + F + G)^-1 * (A + B + C + D + E + F + G +
#> H)^-10 * (A + B + C + D + E + F + H)^-1 * (A + B + C + D + E + G +
#> H)^-1 * (A + B + C + E + F)^-1 * (A + B + C + E + F + G)^-2 * (A + B +
#> C + E + F + G + H)^-1 * (A + B + C + E + F + H)^-1 * (A + B + E + F)^-1
#> * (A + B + E + F + G)^-1 * (A + B + F)^-1 * (A + B + F + G)^-1 * (A +
#> C)^-1 * (A + C + D + E + G)^-1 * (A + C + D + E + G + H)^-1 * (A + C +
#> E + F + G)^-1 * (A + C + E + G) * (A + C + F)^-1 * (A + C + F + G)^-1 *
#> (A + F)^-1 * (A + F + G)^-1 * B^6 * (B + C + D + E + F + G + H)^-1 * (B
#> + C + D + E + F + H)^-1 * (B + C + D + E + H)^-1 * (B + C + F + H) * (B
#> + D + E + H) * (B + G)^-1 * C^6 * (C + D + E)^-1 * (C + D + E + G)^-1 *
#> (C + D + E + H)^-1 * (C + F)^-2 * (C + F + G + H) * (C + H)^-1 * D^4 *
#> (D + E)^-3 * (D + E + G)^-1 * E^5 * (E + F + G + H) * F^4 * (F + G)^-1
#> * G^5 * H^5)
psubs(icons,tolower(pnames(icons)))
#> log(l^24 * (l + nb + oa + thc)^-20 * (l + nb + oa + wais)^-9 * (l + nb
#> + thc + wais)^-15 * (l + oa + pb + thc)^-11 * (l + oa + pb + wais)^-18
#> * (l + pb + thc + wais)^-16 * nb^32 * (nb + oa + pb + thc)^-18 * (nb +
#> oa + pb + wais)^-8 * (nb + pb + thc + wais)^-18 * oa^14 * pb^30 *
#> thc^24 * wais^9)