Entering edit mode
2.8 years ago
sara_johem
•
0
HI,
I have a PCA text file from a 50KSNP array in "txt" format, the calculation is done by Tassel.
I want to plot the results in R.
I am not a trained user of R I tried to to use "ggbioplot" package and I get the error
"Expected a object of class prcomp, princomp, PCA, or lda"
i don't need to use the procomp function cause I already have the components
could you please guide me towards a solution.
EDIT: I'm not sure my solution will work, as you may run into the same error. An untested hack would be to use
class(data) <- "prcomp"
, but that may not work either.If you have PC1 and PC2 and are looking to draw a biplot, draw a simple scatter plot using those values.
If you've already imported the data, use ggfortify:
See this link on how to add colors, labels, etc