intersect.samples: Intersect samples between datasets.

Description Usage Arguments Value Examples

View source: R/functions.R

Description

In order to make all datasets comparable, we have to make sure they describe the same set of samples. This function takes a list of datasets (i.e. data matrices), takes the intersect of all rownames, and returns a list of datasets with only those samples.

Usage

1

Arguments

data

A list of data matrices. The data matrices need to have rownames.

Value

A list with of data matrices, all with the same set of samples.

Examples

1
2
3
4
5
6
7
8
set.seed(2)
n = 100
p = 100
x1 = matrix(rnorm(n*p), n, p)
x2 = matrix(rnorm(n*p), n, p)
rownames(x1) = rownames(x2) = paste0("X",1:n)
data = list(x1=x1[1:90,], x2=x2[10:100,])
data = intersect.samples(data)

NKI-CCB/iTOP documentation built on May 28, 2019, 3:33 p.m.