View source: R/corColumnOrder.R
corColumnOrder | R Documentation |
This function orders columns in list of matrixes (or matrix) according to argument sampNames
and also offers an option for changing names of columns.
It was (initially) designed to adjust/correct the order of samples after import using readMaxQuantFile()
, readProteomeDiscovererFile()
etc.
The input may also be MArrayLM-type object from package limma or
from functions moderTestXgrp
or moderTest2grp
.
corColumnOrder(
dat,
sampNames,
replNames = NULL,
useListElem = c("quant", "raw", "counts"),
annotElem = "sampleSetup",
newNames = NULL,
silent = FALSE,
debug = FALSE,
callFrom = NULL
)
dat |
(matrix, list or MArrayLM-object from limma) main input of which columns should get re-ordered, may be output from |
sampNames |
(character) column-names in desired order for output (its content must match colnames of |
replNames |
(character) option for replacing column-names by new/different colnames; should be vector of NEW column-names (in order as input from |
useListElem |
(character) in case |
annotElem |
(character) name of list-element of |
newNames |
depreciated, pleqse use |
silent |
(logical) suppress messages |
debug |
(logical) display additional messages for debugging |
callFrom |
(character) allows easier tracking of messages produced |
This function returns an object of same class as input dat
(ie matrix, list or MArrayLM-object from limma)
readMaxQuantFile
, readProteomeDiscovererFile
; moderTestXgrp
or moderTest2grp
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])
corColumnOrder(dat2, sampNames=LETTERS[1:5], replNames=c("Dd","Aa","Cc","Ee","Bb"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.