title: Coloring points in a pairs plot
body: <p>I would like to color points in a pairs plot based of certain row indexes. Here is the code I used for plotting 1 variable against another. </p>
  
  <pre><code>cases&lt;-which(rownames(data_no_na) %in% colnames(tumor_data))
  controls&lt;-which(rownames(data_no_na) %in% colnames(control_data))
  
  plot(y=range(pca[,1]),x=range(pca[,2]),type='n',xlab="Principle Component 2",ylab="Principle Component 1", main="Iterative Thresholding Sparse PCA")
  
  points(y=pca[cases,1], x=pca[cases,2], col = 'red' )
  points(y=pca[controls,1], x=pca[controls,2], col = 'blue' );
  </code></pre>
  
  <p>A simple pairs plot is something like:</p>
  
  <pre><code>pairs(pca[,1:3])
  </code></pre>
  
  <p>EDIT: EXAMPLE:</p>
  
  <pre><code>cases&lt;-1:10
  controls&lt;-11:20
  
  pca&lt;-matrix(c(rnorm(3*10,0,1),rnorm(3*10,5,1)),nrow=20,ncol=3)
  </code></pre>