corColumnOrder {wrProteo} | R Documentation |
Order Columns In List Of Matrixes And Vectors
Description
This function orders columns in list of matrixes (or matrix) according to argument sampNames
.
It can be used to adjust/correct the order of samples after reading data using readMaxQuantFile()
, readProteomeDiscovererFile()
etc.
The input may also be MArrayLM-type object from package limma or
from functions moderTestXgrp
or moderTest2grp
.
Usage
corColumnOrder(
dat,
replNames = NULL,
sampNames,
useListElem = c("quant", "raw", "counts"),
annotElem = "sampleSetup",
newNames = NULL,
silent = FALSE,
debug = 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 |
replNames |
(character) new column-names (in order as input from |
sampNames |
(character) column-names in desired order for output (must match colnames of |
useListElem |
(character) in case |
annotElem |
(character) name of list-element of |
newNames |
depreciated, plese use |
silent |
(logical) suppress messages |
debug |
(logical) display additional messages for debugging |
callFrom |
(character) allow easier tracking of messages produced |
Value
This function returns an object of same class as input dat
(ie matrix, list or MArrayLM-object from limma)
See Also
readMaxQuantFile
, readProteomeDiscovererFile
; moderTestXgrp
or moderTest2grp
Examples
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])
dat2 <- list(quant=dat1, raw=dat1)
dat2
corColumnOrder(dat2, sampNames=LETTERS[1:5])