Skip to contents

plot PCA

Usage

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

Examples



istar <- sim_lfq_data_protein_config(with_missing = TRUE, weight_missing = .8, Nprot = 3000)
#> creating sampleName from fileName column
#> completing cases
#> completing cases done
#> setup done
config <- istar$config
analysis <- istar$data
tmp <- plot_pca(analysis, config, add_txt= TRUE, nudge = 0.01)
#> PCA: removed 2459 of 2986 features with missing values. For PCA with all features, impute first using LFQDataImp.
#> Joining with `by = join_by(sampleName)`
print(tmp)


stopifnot("ggplot" %in% class(tmp) )
tmp <- plot_pca(analysis, config, add_txt= FALSE)
#> PCA: removed 2459 of 2986 features with missing values. For PCA with all features, impute first using LFQDataImp.
#> Joining with `by = join_by(sampleName)`
stopifnot("ggplot" %in% class(tmp) )
tmp <- plot_pca(analysis, config, PC = c(1,2))
#> PCA: removed 2459 of 2986 features with missing values. For PCA with all features, impute first using LFQDataImp.
#> Joining with `by = join_by(sampleName)`
stopifnot("ggplot" %in% class(tmp) )
tmp <- plot_pca(analysis, config, PC = c(2,40))
#> PCA: removed 2459 of 2986 features with missing values. For PCA with all features, impute first using LFQDataImp.
#> Warning: nr of PCs: 13
print(tmp)
#> NULL