as.double.snp.data: Attempts to convert snp.data to double

Description Usage Arguments Value Author(s) See Also Examples

Description

A function to convert an object of snp.data-class to "double"

Usage

1
2
	## S3 method for class 'snp.data'
as.double(x, ...)

Arguments

x

An object of snp.data-class

...

...

Value

A matrix containing genotypes in double (numeric) format

Author(s)

Yurii Aulchenko

See Also

as.character.snp.data, as.hsgeno, as.genotype.snp.data

Examples

1
2
3
require(GenABEL.data)
data(srdta)
as.double(srdta@gtdata[1:5,1:10])

Example output

Loading required package: MASS
Loading required package: GenABEL.data
   rs10 rs18 rs29 rs65 rs73 rs114 rs128 rs130 rs143 rs150
p1    0    0    0    1    0     0     0     0     2     2
p2    0    0   NA   NA    0     0     0     2     0     0
p3    0    0   NA    1    0     0     0     0     2     2
p4    0    0   NA   NA    0     0     0     2    NA     1
p5    0    1    0    2    0     0     0     2     2     2

GenABEL documentation built on May 30, 2017, 3:36 a.m.