plot PCA

plot_pca(data, config, PC = c(1, 2), add_txt = FALSE, plotly = FALSE)

Examples





istar <- sim_lfq_data_protein_config(with_missing = FALSE)
#> creating sampleName from fileName column
#> completing cases
config <- istar$config
analysis <- istar$data
tmp <- plot_pca(analysis, config, add_txt= TRUE)
#> Joining with `by = join_by(sampleName)`
stopifnot("ggplot" %in% class(tmp) )
tmp <- plot_pca(analysis, config, add_txt= FALSE)
#> Joining with `by = join_by(sampleName)`
stopifnot("ggplot" %in% class(tmp) )
tmp

tmp <- plot_pca(analysis, config, PC = c(1,2))
#> Joining with `by = join_by(sampleName)`
stopifnot("ggplot" %in% class(tmp) )
tmp <- plot_pca(analysis, config, PC = c(2,40))
#> Warning: nr of PCs: 11
stopifnot(is.null(tmp))