title: R: unexpected results from p.adjust (FDR)
body: <p>This issue arose when I was trying to use <code>p.adjust</code> to run FDR adjustment on a vector of p-values. The problem was that many of the resultant p-values were identical. I thought this might be some quirk with my data, but I have reproduced this same problem with arbitrary input vectors. For example:</p>
  
  <pre><code>temp &lt;- runif(40, min = 0, max = 1) 
  temp
  
  # [1] 0.81563482 0.17471363 0.74697979 0.88755248 0.69676260 0.58207008
  # [7] 0.87138747 0.76432908 0.64352955 0.06501659 0.70680646 0.81557281
  #[13] 0.58480274 0.19476004 0.01035137 0.46119840 0.17783440 0.71828874
  #[19] 0.30978182 0.76902202 0.01615609 0.93122152 0.37936458 0.52369562
  #[25] 0.90997054 0.30098383 0.70873206 0.71159740 0.38148526 0.78415579
  #[31] 0.64605509 0.18898361 0.76770495 0.40651004 0.42255944 0.68395505
  #[37] 0.51844368 0.25855720 0.12090991 0.50110836
  
  p.adjust(temp, method="fdr")
  
  # [1] 0.9062609 0.9062609 0.9062609 0.9312215 0.9062609 0.9062609 0.9312215
  # [8] 0.9062609 0.9062609 0.8668878 0.9062609 0.9062609 0.9062609 0.9062609
  #[15] 0.3231218 0.9062609 0.9062609 0.9062609 0.9062609 0.9062609 0.3231218
  #[22] 0.9312215 0.9062609 0.9062609 0.9312215 0.9062609 0.9062609 0.9062609
  #[29] 0.9062609 0.9062609 0.9062609 0.9062609 0.9062609 0.9062609 0.9062609
  #[36] 0.9062609 0.9062609 0.9062609 0.9062609 0.9062609
  </code></pre>
  
  <p>I would like to think that I am making some mistake. I don't believe it is reasonable for FDR to adjust the p values to all the same value. Most of the data is identical and not all in keeping with original p-value. Any ideas what is wrong here? Thanks.</p>