These are the RMarkdowns which were used for the analyses in the papers, including the knitted html.
If you are interested in applying the PCA approach onto your own data, you this line is the most relevant:
#Run PCA
pca_sleep <- principal(your_data_frame, nfactors=5, residuals = TRUE, rotate="promax", method="regression" , oblique.scores = TRUE)
pca_sleep
This uses the principal command of the psych package.