Learn R Programming

wrProteo (version 1.5.0)

corColumnOrder: Order columns in list of matrixes (or matrix)

Description

This function orders columns in list of matrixes (or matrix) according to argument sampNames. This function can be used to adjut/correct the order of samples after reading data using readMaxQuantFile(), readPDExport() etc. The input may also be MArrayLM-type object from package limma or from moderTestXgrp or moderTest2grp.

Usage

corColumnOrder(
  dat,
  sampNames,
  useListElem = c("quant", "raw"),
  silent = FALSE,
  callFrom = NULL
)

Arguments

dat

(matrix, list or MArrayLM-object from limma) main input of which columns should get re-ordered, may be output from moderTestXgrp or moderTest2grp.

sampNames

(character) column-names in desired order for output

useListElem

(character) in case dat is list, all list-elements who's columns should get (re-)ordered

silent

(logical) suppress messages

callFrom

(character) allow easier tracking of message(s) produced

Value

object of same class as input dat

See Also

moderTestXgrp for single comparisons, order

Examples

Run this code
# NOT RUN {
grp <- factor(rep(LETTERS[c(3,1,4)], c(2,3,3)))
dat1 <- matrix(1:15, ncol=5, dimnames=list(NULL,c("D","A","C","E","B")))
corColumnOrder(dat1,sampNames=LETTERS[1:5])  

dat1 <- list(quant=dat1,raw=dat1)
  dat1
corColumnOrder(dat1,sampNames=LETTERS[1:5]) 
# }

Run the code above in your browser using DataLab