pedrenum | R Documentation |
Converts the identifiers in column Id of a dataframe into numeric codes which form a sequence from 1 to n with unit increments and no duplicates. Converts the identifiers in columns SId and DId to correspond.
pedrenum(df)
df |
A dataframe containing columns named Id, SId, and DId as required to include pedigree information |
It is assumed that any identifiers in columns SId or DId also appear in column Id. If not use function mdf()
instead of function pedrenum()
. Function mdf()
actually calls function pedrenum()
, but ensures that the above requirement is met first.
A dataframe containing the renumbered Id, SId, and DId columns, as well as any other columns present in argument df
Function pedrenum()
is an internal function called by function mdf()
. It is made available because it may be useful in cases where the complex dataframe manipulations performed by function mdf()
are not required.
Neville Jackson
Function mdf()
library(dmm)
data(dt8bal.df)
# note these data do not need renumbering, but will use as a demo
tmprenum <- pedrenum(dt8bal.df)
# In this case all that happens is that SId, which was a factor in dt8bal.df, is
# converted back to int. The numeric codes are unaltered.
rm(dt8bal.df)
rm(tmprenum)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.