draw_sex: Draw sex values randomly for a list of individuals

View source: R/draw_sex.R

draw_sexR Documentation

Draw sex values randomly for a list of individuals

Description

Each individual has their sex drawn between male and female with equal probability. Sex is encoded numerically following the convention for plink FAM files (see below).

Usage

draw_sex(n)

Arguments

n

The number of individuals.

Value

The length-n vector of integer sex assignments: 1L corresponds to male, 2L to female.

See Also

Plink FAM format reference: https://www.cog-genomics.org/plink/1.9/formats#fam

Examples

draw_sex( 10 )


simfam documentation built on Jan. 10, 2023, 1:06 a.m.