I have a dataset with 30 columns and 538 rows and I tried to run the prcomp, but it turns out it does not work with missing values and I can't use the na.omit because I would end up with one row only and that's useless for this purpose.
This is just the head of the df. Note that the first column is useless and I wanted to sort by group in the PCA plot. The dataset is avaliable here.
specimen group total_length max_w n_prog ceph_pedun_L bothrid_L bothrid_W n_loculi n_transv_septa stalk_L stalk_W prog_max_W term_seg_L term_seg_L ratio_term_seg term_seg_SA pore_pst_mrgn percent_ prog_L n_progl_LgrW n_mat_segs n_testes testes_L testes_W length_tst_field term_c_sac_L term_c_sac_W ovary_L Ov_ratio_prog OV_max_W RN04_62_1 brooksi 6 820 240 7 190 120 320 RN04_62_2 brooksi 7.5 980 250 8 240 140 430 RN04_81_2 copianullum 8 RN04_81_3 paratrygonyi 8 RN04_81_4 fulbrighti 7 TO_05_80_5 fulbrighti 20 2000 310 10 350 140 710
I looked it up and there are a few ways to go around this problem:
- run a probabilistic PCA
- impute values to the NAs
I tried running PPCA with the pcaMethods package and it did not work.
Could anybody help me out? PS: I wanted to run the prcomp to get a biplot from the ggbiplot function afterwards. PS2: I moved my post from stackoverflow to here as it was suggested to me.