title: plot of categorical variables with R
body: <p>I'm a newcomer both to R and statistics in general.
  I'm trying to plot the relationship of two categorical variables which are vectors of length 147.
  The tables for each are:</p>
  
  <pre><code>    AgeGroup
  26-49   50-64   65 and over  Under 26
  101     16      5            25
  </code></pre>
  
  <p>and</p>
  
  <pre><code>    Role
  A/C     C/H                     Dietician
  6       8                       2
  Doctor  Healthcare Assistant    Lab
  56      7                       2
  Nurse   Pharmacist              Phlebotomist
  54      5                       1
  Radiographer                    Therapist
  1                               5
  </code></pre>
  
  <p>After reading an answer to a question here from 2012 I expected to get a spineplot by using this command:</p>
  
  <pre><code>    plot(mydata$Role,mydata$AgeGroup,xlab="Role",ylab="Age Group")
  </code></pre>
  
  <p>but it returns:</p>
  
  <pre><code>    Error in plot.window(...) : need finite 'xlim' values
  In addition: Warning messages:
  1: In xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by coercion
  2: In xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by coercion
  3: In min(x) : no non-missing arguments to min; returning Inf
  4: In max(x) : no non-missing arguments to max; returning -Inf
  5: In min(x) : no non-missing arguments to min; returning Inf
  6: In max(x) : no non-missing arguments to max; returning -Inf
  </code></pre>
  
  <p>I'm guessing that Warning message 1 is telling me that xycoords() is attempting to
  coerce the categorial elements into numeric data and when it fails to do so
  is returning NAs, which gives plot() nothing to work with.<br>
  In short, what am I failing to understand and how do I fix it?</p>