data.form: Convert input data into appropriate format for TANOVA

Description Usage Arguments Value Author(s) See Also Examples

View source: R/data.form.R

Description

This is an internal function to be called by tanova to format input data into appropriate format. Users should call tanova whenever is possible.

Usage

1
data.form(data, f1, f2, tp)

Arguments

data

data matrix (gene * array). Each row is a gene. Each column is an array. If data is longitudinal (e.g., time course measurements from patients), arrays from same experimental units (e.g. patient) should be next to each other (but not necessary in time course order.

f1

a vector of length equal to the number of arrays. Each entry indicates the level of the first factor for corresponding array. The values of f1 should be numeric 1,2,3...

f2

a vector of length equal to the number of arrays. Each entry indicates the level of the second factor for the corresponding array. The values of f2 should be numeric 1,2,3... If there's only one factor, let f2=0.

tp

a vector of length equal to the number of arrays. Each entry indicates the time point for the corresponding array. The values of tp should be numeric 1,2,3 ... For non-time course data, let tp=0.

Value

The output is a list object.

d

data matrix. nrow=#genes*#time points, ncol=factor levels (#factor1*#factor2). Rows are ordered by gene name and then by time points.

fc1

a vector of length equal to the number of arrays divided by the number of time points. Each entry indicates the level of the first factor for the group of arrays with the same combination of factor levels. The values of fc1 should be numeric 1,2,3...

fc2

a vector of length equal to the number of arrays divided by the number of time points. Each entry indicates the level of the first factor for the group of arrays with the same combination of factor levels. The values of fc1 should be numeric 1,2,3...

Author(s)

Baiyu Zhou [email protected] & Weihong xu [email protected]

See Also

tanova

Examples

1
2
3
4
5
	##f1=rep(1:2, each=8)
	##f2=rep(c(1,2,1,2), each=4)
	##tp=rep(1:4, 4)
	##data=matrix(rnorm(16*1000), nrow=1000, ncol=16)
	##formated.data=data.form(data,f1,f2,tp)

TANOVA documentation built on May 29, 2017, 12:31 p.m.