title: Keep getting an error when running the LDA function in R, I am using the MASS library for the LDA
body: <p>I having trouble with the LDA function in R. Any help would be great!.</p>
  
  <pre><code> &gt; bond &lt;- read.csv("BondRating.csv")
   &gt; head(bond)
  
  RATING OBS CODERTG LOPMAR LFIXCHAR LGEARRAT LTDCAP LLEVER LCASHLTD LACIDRAT LCURRAT LRECTURN LASSLTD
  
  1    AAA ,  8,       1, -1.323,    0.998,   -0.936,  0.281,-0.042,   -0.187  0.001,   0.863,    1.349,   1.704,
  
  2    AAA,   9,       1, -2.100,    1.516,   -1.654,  0.159, 0.251,    0.342,   -0.077,   0.347,    1.762,   2.515,
  
  &gt; lda(RATING~.,data = bond)
  
  Error in lda.default(x, grouping, ...) : 
  </code></pre>
  
  <p>variable 2 appears to be constant within groups</p>
  
  <pre><code> 'data.frame':  14 obs. of  13 variables:
  $ RATING  : Factor w/ 7 levels "A","AA","AAA",..: 3 3 2 2 1 1 6 6 5 5 ...
  $ OBS     : int  8 9 23 24 37 38 52 53 67 68 ...
  $ CODERTG : int  1 1 2 2 3 3 4 4 5 5 ...
  $ LOPMAR  : num  -1.32 -2.1 -1.74 -1.78 -1.7 ...
  $ LFIXCHAR: num  0.998 1.516 1.626 1.153 3.691 ...
  $ LGEARRAT: num  -0.936 -1.654 -1.207 -0.45 -3.155 ...
  $ LTDCAP  : num  0.281 0.159 0.23 0.389 0.04 0.369 0.249 0.257 0.233 0.288 ...
  $ LLEVER  : num  -0.042 0.251 -0.066 0.171 -0.936 0.013 -0.101 -0.049 -0.244 -0.024 ...
  $ LCASHLTD: num  -0.187 0.342 -0.266 -0.898 1.573 ...
  $ LACIDRAT: num  0.001 -0.077 -0.229 -0.073 0.122 0.07 -0.709 -0.225 0.022 -0.006 ...
  $ LCURRAT : num  0.863 0.347 0.543 0.44 0.998 0.781 0.787 0.476 0.726 0.569 ...
  $ LRECTURN: num  1.35 1.76 1.72 2.23 2.03 ...
  $ LASSLTD : num  1.7 2.52 1.92 1.25 3.49 ...
  </code></pre>