Hi folks,
I am a newbie who is self-teaching R. However, I have run into an issue I can't seem to get an answer to.
I have a data frame (df1) with approximately 40 variables and 300 observations. I have run PCA (prcomp(df1)) on it and then turned the pca$scores into a data-frame (df2).
What I want to do now is take the df2 and select data from the df2 by using the values in the first two columns. So if entries in column 1 are between -2 and 2 and values in column 2 are between -5 to 5, I want all of the data in the rows and columns placed into another table.
The reason for this is I want to run PCA again on a subset of the original PCAs data. So I have from the individuals' plots found a cluster of data that is contained within certain PC1 and PC2 corrdinates. See attached graphic.
I am trying to reproduce the double PCA technique discussed in the following paper - "Statistical evaluation of elemental concentrations in shallow-marine deposits (Cretaceous, Lusitanian Basin)" Coimbra et al., 2017.
Thanks in advance for any help you can provide.