pca_obj <- prcomp(onze_intercepts |> dplyr::select(-speaker), scale=TRUE)
# flip the second PC
flipped_pca <- pc_flip(pca_obj, pc_no = 2)
# flip (if necessary) the third PC, so that the "F1_GOOSE" variable has
# a positive loading
flipped_pca <- pc_flip(pca_obj, pc_no = 3, flip_var = "F1_GOOSE")
Run the code above in your browser using DataLab