psubs: Substitute players of a hyper2 object

Description Usage Arguments Details Value Author(s) Examples

Description

Given a hyper2 object, substitute some players

Usage

1
2
psubs(H, from, to)
psubs_single(H, from, to)

Arguments

H

hyper2 object

from,to

Character vector of players to substitute and their substitutes

Details

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.

Value

Returns a hyper2 object

Author(s)

Robin K. S. Hankin

Examples

1
2
3
4
5
psubs(icons,c("L","NB"),c("London","Norfolk Broads"))

rhyper2() %>% psubs(letters,LETTERS)   # ignore i,j,k,...,z

psubs(icons,tolower(pnames(icons)))

hyper2 documentation built on Oct. 25, 2021, 9:10 a.m.