title: How can I write a test function like this?
body: <p>How can I write a function to check cases(x,y) by the two 
  tests:</p>
  
  <p>One</p>
  
  <pre><code>if y==rank(y) 
  </code></pre>
  
  <p>Two</p>
  
  <pre><code>xranks &lt;- rank(x)
  yranks &lt;- rank(y)
  meanx &lt;- mean(xranks)
  meany &lt;- mean(yranks)
  covariance.term &lt;- cov(xranks-meanx,y-meany)
  sd.x &lt;- sd(xranks)
  sd.y &lt;- sd(yranks)
  if -1&lt;= covariance.term/(sd.x*sd.y) &lt;=1
  </code></pre>
  
  <p>and should return <code>TRUE</code> if both tests are passed, or <code>FALSE</code>, with warnings about which tests failed.</p>