Learn R Programming

MultiDataSet (version 1.0.2)

add_snps: Method to add a slot of SNPs to MultiDataSet.

Description

This method adds or overwrites the slot "snps" of an MultiDataSet with the content of the given SnpSet.

Usage

add_snps(object, snpSet, ...)

Arguments

object
MultiDataSet that will be filled.
snpSet
SnpSet to be used to fill the slot.
...
Arguments to be passed to add_eset.

Value

A new MultiDataSet with the slot "snps" filled.

Examples

Run this code
multi <- createMultiDataSet()
geno <- matrix(c(3,1,2,1), ncol = 2)
colnames(geno) <- c("VAL0156", "VAL0372")
rownames(geno) <- c("rs3115860", "SNP1-1628854")
map <- AnnotatedDataFrame(data.frame(chromosome = c("chr1", "chr2"), position = c(12414, 1234321),
     stringsAsFactors = FALSE))
rownames(map) <- rownames(geno)
snpSet <- new("SnpSet", call = geno, featureData = map)
pheno <- data.frame(id = c("VAL0156", "VAL0372"))
rownames(pheno) <- c("VAL0156", "VAL0372")
pData(snpSet) <- pheno
multi <- add_snps(multi, snpSet)

Run the code above in your browser using DataLab