do_pca <- function(data, verbose = FALSE, scaledata = FALSE){
if(ncol(data) < 50){
npcs <- ncol(data) - 2
} else {
npcs <- 50
}
if (scaledata){
data <- FindVariableFeatures(data, verbose = verbose)
data <- ScaleData(data, verbose = verbose)
}
data <- RunPCA(data, npcs = npcs, verbose = verbose, seed.use = 42)
data
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.