plotPCALoadings {MatrixQCvis} | R Documentation

## Plot for PCA loadings of features

### Description

The function 'plotPCALoadings' creates a loadings plot of the features.

### Usage

    plotPCALoadings(tbl, x_coord, y_coord)

### Arguments

`tbl` | 'tbl' as obtained by the function 'ordination'
`x_coord` | 'character', column name of 'tbl' that stores x coordinates
`y_coord` | 'character', column name of 'tbl' that stores y coordinates

### Details

The function takes as input the output of the function 'tblPlotPCALoadings'. It uses the 'ggplotly' function from 'plotly' to create an interactive 'plotly' plot.

### Value

'plotly'

### Author(s)

Thomas Naake

### Examples

    x <- matrix(rnorm(1:10000), ncol = 100)
    rownames(x) <- paste("feature", 1:nrow(x))
    colnames(x) <- paste("sample", 1:ncol(x))
    params <- list(method = "euclidean", ## dist
        initial_dims = 10, max_iter = 100, dims = 3, perplexity = 3, ## tSNE
        min_dist = 0.1, n_neighbors = 15, spread = 1) ## UMAP
    tbl <- tblPCALoadings(x, params)
    plotPCALoadings(tbl, x_coord = "PC1", y_coord = "PC2")

[Package MatrixQCvis version 1.0.0 Index]