title: R how to assign two different colours according to categorical variables in rect graph?
body: <p>Is there a way to assign two different colours according to categorical values in rect graph??</p>
  
  <pre><code>rect(0, yb, Studies.sort,yt,col=("black","lightgray"[Area$"Theory"])
  </code></pre>
  
  <p>obviously.. this is wrong.....</p>
  
  <p>Area consist of two categorical variables - "Theory" and "Vocational".</p>