subset.lineupdist: Subsetting distance matrix

Description Usage Arguments Value Author(s) See Also Examples

View source: R/subset.lineupdist.R

Description

Pull out a specified set of rows and columns from a distance matrix calculated by distee or disteg.

Usage

1
2
3
4
5
## S3 method for class 'lineupdist'
subset(x, rows = NULL, cols = NULL, ...)

## S3 method for class 'lineupdist'
x[rows = NULL, cols = NULL]

Arguments

x

A distance matrix object as obtained from distee or disteg.

rows

Optional vector of selected rows.

cols

Optional vector of selected columns.

...

Ignored at this point.

Value

The input distance matrix object, but with only the specified subset of the data.

Author(s)

Karl W Broman, [email protected]

See Also

disteg, distee, pulldiag

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
data(expr1, expr2)


# find samples in common
id <- findCommonID(expr1, expr2)

# calculate correlations between cols of x and cols of y
thecor <- corbetw2mat(expr1[id$first,], expr2[id$second,])

expr1s <- expr1[,thecor > 0.8]/1000
expr2s <- expr2[,thecor > 0.8]/1000

# calculate correlations among samples
d <- distee(expr1s, expr2s, d.method="cor")

# pull out distances for samples 24, 92, 44, 66
samp <- c("24", "92", "44", "66")
d[samp, samp]

kbroman/lineup documentation built on Dec. 4, 2017, 11:41 p.m.