R/dimred_pca.R

Defines functions dimred_pca

Documented in dimred_pca

#' @rdname dimred
#' @importFrom irlba prcomp_irlba
#' @export
dimred_pca <- function(x, ndim = 2) {
  space <- irlba::prcomp_irlba(x, n = ndim)$x

  # pca <- irlba::irlba(x, nv = ndim)
  # space <- pca$u
  # rownames(pca) <- rownames(x)
  # colnames(pca) <- paste0("comp_", seq_len(ncol(pca)))

  .process_dimred(space, rn = rownames(x))
}

Try the dyndimred package in your browser

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

dyndimred documentation built on March 23, 2021, 9:06 a.m.