family              package:GeneticsPed              R Documentation

_F_i_n_d _f_a_m_i_l_i_e_s (_l_i_n_e_s) _i_n _t_h_e _p_e_d_i_g_r_e_e

_D_e_s_c_r_i_p_t_i_o_n:

     'family' classifies individuals in the pedigree to distinct
     families or lines. Two individuals are members of one family if
     they have at least one common ascendant. 'family<-' provides mean
     to properly add family information into the pedigree.

_U_s_a_g_e:

     family(x)
     family(x, col=NULL) <- value

_A_r_g_u_m_e_n_t_s:

       x: pedigree object

     col: character, column name in 'x' for family

   value: family values for individuals in the pedigree

_D_e_t_a_i_l_s:

     'col' provides a mean to name or possibly also rename family
     column with user specified value, say "familia" in Spanish. When
     'col=NULL', which is default, "family" is used.

_V_a_l_u_e:

     A vector of family values (integers)

_A_u_t_h_o_r(_s):

     Gregor Gorjanc

_S_e_e _A_l_s_o:

     'Pedigree'

_E_x_a_m_p_l_e_s:

       ## Two families examples
       ped <- data.frame(    id=c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11),
                         father=c(0, 0, 0, 0, 0, 0, 5, 1, 3,  8,  7),
                         mother=c(0, 0, 0, 0, 0, 0, 6, 2, 4,  9, 10),
                     generation=c(1, 1, 1, 1, 1, 1, 2, 2, 2,  3,  4))
       ped <- Pedigree(ped, unknown=0, generation="generation")
       family(ped)

       ## After break we get two families
       ped1 <- removeIndividual(ped, individual=11)
       family(ped1)

       ## Subsetting can also be used
       family(ped[1:10,])
       family(ped[7:10,])

       ## Pedigree need not be sorted in advance
       ped2 <- ped[sample(1:10), ]
       family(ped2)

       ## Assign family values to pedigree
       family(ped) <- family(ped)
       ped
       family(ped, col="familia") <- family(ped)
       ped

