R/add.dimnames2db.R

#' a function to add colnames and rownames
#' @description Adding rownames and colnames; A essential step for pheatmap; Lots of plyr steps will lose dimnames
#' @param x: a matrix/dataframe
#' @param cn: colnames to be added
#' @param rn: rownames to be added

add.dimnames2db<-function(x,cn=colnames(x),rn=rownames(x)){
                     x<-as.data.frame(x)
                     colnames(x)<-cn
                     rownames(x)<-rn
                 return(x)}
mssm-msf-2019/BiostatsALL documentation built on May 22, 2019, 12:16 p.m.