
Transform into a factor the STRATA column, change names and reorder the levels
Source:R/strata.R
change_pop_names.RdTransform into a factor the STRATA column, change names and reorder the levels.
Arguments
- data
A GDS filename or open
SeqVarGDSClassobject.- pop.levels
(optional, string) This refers to the levels in a factor. In this case, the id of the pop. Use this argument to have the pop ordered your way instead of the default alphabetical or numerical order. e.g.
pop.levels = c("QUE", "ONT", "ALB")instead of the defaultpop.levels = c("ALB", "ONT", "QUE"). White spaces in population names are replaced by underscore. Default:pop.levels = NULL.- pop.labels
(optional, string) Use this argument to rename/relabel your pop or combine your pop. e.g. To combine
"QUE"and"ONT"into a new pop called"NEW": (1) First, define the levels for your pop withpop.levelsargument:pop.levels = c("QUE", "ONT", "ALB"). (2) then, usepop.labelsargument:pop.labels = c("NEW", "NEW", "ALB"). To rename"QUE"to"TAS":pop.labels = c("TAS", "ONT", "ALB"). Default:pop.labels = NULL. White spaces in population names are replaced by underscore.
Author
Thierry Gosselin thierrygosselin@icloud.com