A team name can sometimes be spelled incorrectly, particularly if there are character encoding issues. This can be a particular problem when combining data from multiple files. If a team name matches the from
entry and/or its ID matches the team_id
entry in a row in remap
, the team will be renamed to the corresponding to
value and/or its ID changed to the corresponding to_team_id
value.
Arguments
- x
datavolley: a datavolley object as returned by
dv_read
, or list of such objects- remap
data.frame: data.frame of strings with one or both columns
from
andteam_id
, and one or both columnsto
andto_team_id
- fixed
logical: treat the
from
andteam_id
entries as fixed strings? Iffixed
isFALSE
they will be treated as regular expressions
Examples
if (FALSE) {
x <- dv_read(dv_example_file(), insert_technical_timeouts = FALSE)
summary(x)
## rename a team based just on team name
summary(remap_team_names(x, data.frame(from="Nova KBM Branik", to="NKBM Branik")))
## rename a team based on team name and ID
summary(remap_team_names(x, data.frame(from="Nova KBM Branik", to="NKBM Branik", team_id="MB4")))
}