readIID: read individual ID

View source: R/bed.R

readIIDR Documentation

read individual ID

Description

Generate individual ID automatically, or based on a fam file.

Usage

readIID(fam, opt = NULL)

Arguments

fam

prefix or name of a PLINK file, or data fram from a FAM file.

opt

option (def=1: the 2nd column in FAM file).

Details

The option (opt) can be:

  • 1 = the iid column in FAM (default),

  • 2 = formated as fid.iid,

  • 0 = nothing

  • -1 = numbering of individuals, decimal

  • -2 = numbering of individuals, zero-padded fix-length decimal

  • -3 = numbering of individuals, zero-padded fix-length hexedemical or, a vector of IDs to use.

Value

a vector of individual ID

Examples

pfx <- file.path(system.file("extdata", package="plinkFile"), "m20")
readIID(pfx,  1) # opt= 1: IID
readIID(pfx,  2) # opt= 2: FID.IID
readIID(pfx, -1) # opt=-1: number sequence
readIID(pfx, -2) # opt=-2: number sequence, fixed length, decimal
readIID(pfx, -3) # opt=-3: number sequence, fixed length, hexidemical


plinkFile documentation built on Nov. 24, 2023, 5:10 p.m.

Related to readIID in plinkFile...