R/pcplot.R

Defines functions pcplot

Documented in pcplot

pcplot <-
function(x, batch, y, alpha=0.35, ...) {
  ##require("MASS")
  p <- ncol(x)
  n <- nrow(x)
  xpr <- prcomp(x, scale. = FALSE)
  xp <- predict(xpr)[,1:2]
  plotc <- plotcomp(xp, groups=batch, y=y, alpha=alpha, ...)
  xm <- tapply(xp[,1], batch, mean)
  ym <- tapply(xp[,2], batch, mean)
  points(xm, ym, col=plotc$col, cex = 2, pch = 18)
  abline(h=0, lty=2)
  abline(v=0, lty=2)
}

Try the bapred package in your browser

Any scripts or data that you put into this service are public.

bapred documentation built on June 22, 2022, 9:08 a.m.