Description Usage Arguments Value Examples
View source: R/fct_factor_extra.R
Get equation formula for loading of PCA results in MathJax formats which can be display in browser.
1 | get_pca_formula(pca_res, pc_name_prefix = NULL, ncp = Inf, digits = 3)
|
pca_res |
An object of class PCA ( |
pc_name_prefix |
A character as name prefix of primary components in results, e.g PC for PC1...PCn. Default NULL means use original name of primary components. |
ncp |
A number of primary components kept in the results. Default Inf means all primary components. |
digits |
How many significant digits are to be used for coefficient in formula. |
A vector of Character of loading formula of Primary Components
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
# Display formula in uiOutput(ns("pca_result_formula"))
# Server function
output$pca_result_formula <- renderUI({
pca_res <- prcomp(iris[, -5], scale = TRUE)
# Get formula of primary components of PCA
pca_formula <- get_pca_formula(pca_res)
pca_formula_mathJax <- purrr::map(pca_formula, .f = helpText)
withMathJax(
pca_formula_mathJax
)
})
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.