Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

recodeBinary

Recode Binary Vectors


Description

This function is called internally by DiNAMIC's peeling function, and by construction the kth entry of binary.vec is 1, where k is described below. If length(binary.vec) = m, then the function produces a binary vector of length m that contains a single contiguous string of 1's, namely the string that contains the 1 in the kth position of binary.vec.

Usage

recodeBinary(binary.vec, k)

Arguments

binary.vec

A binary vector of length m (>= 1) whose kth entry is 1.

k

A positive integer.

Value

A binary vector of length m that contains a single contiguous string of 1's, namely the string that contains the 1 in the kth position of binary.vec.

Author(s)

Vonn Walter, Andrew B. Nobel, Fred A. Wright

Maintainer: <vwalter@email.unc.edu> Vonn Walter

References

Walter, V., Nobel, A.B., and Wright, F.A., DiNAMIC: a method to identify recurrent DNA copy number aberrations in tumors, Bioinformatics (2011) 27(5) 678 - 685.

Examples

test = c(1, 0, 0, 1, 1, 0, 0, 1, 0)
recodeBinary(test, 5)   
#Returns (0, 0, 0, 1, 1, 0, 0, 0, 0)

dinamic

DiNAMIC A Method To Analyze Recurrent DNA Copy Number Aberrations in Tumors

v1.0
GPL-2
Authors
Vonn Walter, Andrew B. Nobel, and Fred A. Wright
Initial release
2011-10-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.