With the code below I have created a correlation matrix. The code below just creates a matrix for all of the data, regardless of treatment. However, a column in my data is treatment. I would like to make two different matrices (one for each treatment type). My treatment a categorical value in column 6 'Treat'. Columns 10 through 44 I would like to create a matrix for.
correlations <- cor(Plants[,c(10:44)], use="pairwise.complete.obs", method="pearson")
correlations<-as.matrix(correlations)