mkm {Kmisc} | R Documentation |
~~ A concise (1-5 lines) description of what the function does. ~~
mkm(obj, numcol = NA, colname = NA, rowname = NA, title = NA, obs = NA)
obj |
~~Describe obj here~~ |
numcol |
~~Describe numcol here~~ |
colname |
~~Describe colname here~~ |
rowname |
~~Describe rowname here~~ |
title |
~~Describe title here~~ |
obs |
~~Describe obs here~~ |
~~ If necessary, more details than the description above ~~
~Describe the value returned If it is a LIST, use
comp1 |
Description of 'comp1' |
comp2 |
Description of 'comp2' |
...
....
~~further notes~~
~Make other sections like Warning with section{Warning }{....} ~
~~who you are~~
~put references to the literature/web site here ~
~~objects to See Also as help
, ~~~
##---- Should be DIRECTLY executable !! ---- ##-- ==> Define data, use random, ##-- or do help(data=index) for the standard data sets. ## The function is currently defined as function(obj, numcol=NA, colname=NA, rowname=NA, title=NA, obs=NA) { rowname <- ifelse(is.na(rowname), "", rowname) colname <- ifelse(is.na(colname), "", colname) title <- ifelse(is.na(title), "", title) if (is.na(numcol)) { numcol <- ncol(obj) title <- c(title, rep("", numcol)) colname <- c("", colname, rep("", numcol-1)) x <- as.matrix(obj) x <- cbind(rownames(obj), x) x <- rbind(c(rowname, colnames(obj)), x) } else { title <- c(title, rep("", numcol)) colname <- c("", colname, rep("", numcol-1)) x <- cbind(rownames(obj), as.matrix(obj), matrix("", nrow(obj), numcol-ncol(obj))) x <- rbind(c(rowname, colnames(obj), rep("", numcol-ncol(obj))), x) } if (is.list(obs)) { obs <- sapply(obs, function(x) { if(any(is.na(x))) rep("", numcol+1) else c(x, rep("", numcol-length(x)+1)) }) obs <- t(obs) } else { obs <- if(any(is.na(obs))) rep("", numcol+1) else c(obs, rep("", numcol-length(obs)+1)) } return(rbind(title, colname, x, obs)) }