The function can be used in a chunk within a Rmarkdown document/script with results="asis" to render the report.

pca_report(data, design, id_var = "Sample_ID", technical_vars,
  n_comp = 5, fig_n_comp = n_comp, outliers_component = NULL,
  outliers_threshold = 3, title_level = 2)

Arguments

data

A vector or data.frame. The data on which the PCA has to be performed.

design

A data.frame. Additional variables to be used with factorial planes.

id_var

A character. The identifier column used to merge the data.

technical_vars

A vector(character). Variables from design to be used with factorial planes.

n_comp

A numeric. The number of principal components to be computed.

fig_n_comp

A numeric. The number of principal components to be used for figures.

outliers_component

A logical. The principal components to be used to outliers detection.

outliers_threshold

A numeric. The threshold to define outliers.

title_level

A numeric. The markdown title level, i.e., the number of # preceding the section.

Value

A data.frame.