ExtractPCA.RdThis function extracts PCA loadings stored in the DimReduction slot of a
geneda object and combines them with the associated metadata. It ensures
that the metadata has valid rownames and aligns the PCA loadings accordingly.
ExtractPCA(object)A data.frame combining PCA loadings and sample metadata, where rows correspond
to samples and columns include principal component loadings and metadata fields.
The function performs several checks:
Ensures the input object is of class geneda.
Verifies that the DimReduction slot contains PCA loadings.
Confirms that the metadata has valid rownames.
Reorders the PCA loadings to match the order of metadata rows.
If metadata rownames are missing or invalid, the function throws an error.
if (FALSE) { # \dontrun{
# Example usage:
pca_results <- ExtractPCA(my_geneda_object)
head(pca_results)
} # }