plot.mult {Kmisc} | R Documentation |
~~ A concise (1-5 lines) description of what the function does. ~~
plot.mult(x, col = 1:ncol(x), mid = TRUE, pch = "x", ...)
x |
~~Describe x here~~ |
col |
~~Describe col here~~ |
mid |
~~Describe mid here~~ |
pch |
~~Describe pch here~~ |
... |
~~Describe ... 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(x, col=1:ncol(x), mid=TRUE, pch="x", ...) { names(col) <- colnames(x) x <- exclui.na(x) col <- col[is.element(names(col), colnames(x))] print(col) if (is.null(dim(x))) return(NA) x[is.na(x)] <- 0 nr <- nrow(x) nc <- ncol(x) bt <- apply(x, 1, function(x) lapply(x, binom.test, sum(x))) ici <- sapply(bt, lapply, function(x) x$conf.int[[1]]) ics <- sapply(bt, lapply, function(x) x$conf.int[[2]]) if (mid) { p <- sapply(bt, lapply, function(x) x$estimate) ic <- lapply(1:nr, function(x,m,i,s) cbind(Media=unlist(m[, x]), Inferior=unlist(i[, x]), Superior=unlist(s[, x])), p, ici, ics) } else ic <- lapply(1:nr, function(x,i,s) cbind(Inferior=unlist(i[, x]), Superior=unlist(s[, x])), ici, ics) barplot(unlist(x[1,]), col="white", border="white", ...) cloc <- ((1:nr)-mean(1:nr))/(2*nr) for (i in 1:nr) { arrows.ic((1:nc)*1.2-0.5+cloc[i], ic[[i]], col=col[i], mid=mid, pch=pch) } }