Learn R Programming

plinkFile (version 0.2.1)

readIID: read individual ID

Description

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

Usage

readIID(fam, opt = NULL)

Value

a vector of individual ID

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.

Examples

Run this code
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

Run the code above in your browser using DataLab