title: Microarray Data: Finding Probes that have NO missing observations
body: <p>Quite often, you'll download data and you want to know the difference in expression levels. Things get complicated as you can have more than one probe per sample. </p>
  
  <p>In the following example, we have only two samples (i.e. 1 and 4): </p>
  
  <p>Your <code>data</code> file will look something like this</p>
  
  <pre><code>  ProbeID      SampleID ExperimID    Value    Type
  1 2747406        1         2      6.449200 AFFEXON
  2 2747407        4         2      6.455550 AFFEXON
  3 2747408        1         2      6.534564 AFFEXON
  4 2747408        4         2      6.453523 AFFEXON
  ..etc
  </code></pre>
  
  <p>To see the issue at hand, extract sample 1 and 4 and see whether the vector lengths match:</p>
  
  <pre><code>Sample1 &lt;- data[ data$SampleID == 1, ]    #Extract from data where SampleID == 1
  Sample4 &lt;- data[ data$SampleID == 4, ]    #Extract from data where SampleID == 4
  dim(Sample1)                              #Return length of row and col using dim()
  [1] 1012703  5 
  dim(Sample4)
  [1] 1411399  5
  </code></pre>
  
  <p>As seen above, the number of probes is unequal between the samples. This will create unequal  vector lengths for downstream analysis, making it difficult to COMPARE expression levels between the TWO samples. Thus, you need to find the probes with NO missing observations (i.e. we want probes that have 2 hits or frequency of 2, since we have 2 samples, and ignore the 1 hit probes. This will produce equal vector lengths and allow us to COMPARE expression levels between the TWO samples. </p>
  
  <p>Here is one way of doing it:</p>
  
  <pre><code>probeTbl &lt;- table(data[,1])               #Export probes into a table
  head(probTbl)                             #Notice freq! We don't want the 1 hit ones.
  2315101 2315102 2315103 ... 
    2       1       1
  probeToSample &lt;- which(probeTbl == 2)     #Export only those with 2 observations
  head(probeToSample)                       #Check that probes -&gt; to new variable
  2315101 2315102 2315103 ...
    1       2       3               
  numericPtoS &lt;- as.numeric                 #Extract probeToSample as numeric vector 
  (names(probeToSample))
  
  WorkingData &lt;- data[,1] %in% numericPtoS  #Use %in% logic operator to match original         
                                             #data with new vector numericPtoS, which 
                                             #contains desired hits or observations == 2
  </code></pre>
  
  <p>If anyone has a better way, please chip in. . . </p>