You can wrap a function call as follows:
plotMDS.invisible <- function(...){ ff <- tempfile() png(filename=ff) res <- plotMDS(...) dev.off() unlink(ff) res }
Call example:
x <- matrix(rnorm(1000*6,sd=0.5),1000,6) rownames(x) <- paste("Gene",1:1000) x[1:50,4:6] <- x[1:50,4:6] + 2 # without labels, indexes of samples are plotted. mds <- plotMDS.invisible(x, col=c(rep("black",3), rep("red",3)) )
source share