title: Error in indval (labdsv) in R - "All species must occur in at least one plot"
body: <p>I ran the following Indicator Species Analysis (indval) code from labdsv package in R on a dataframe called &quot;data&quot; where species abundances are columns and sites are rows as below:</p>
  <pre><code>     Site    Species X  Species Y  Species Z etc
       1       10         3          5
       2       5          15         220
       3       0          1          0
       4       21         100        3
  </code></pre>
  <p>In a separate file is the corresponding Group data for each site which is either group 1 or group 2 (called this spe.grp), that is the following:</p>
  <pre><code>    Groups 
      1
      2
      1
      2
     
  </code></pre>
  <p>I removed categorical variables so that spe.only has only the species data</p>
  <pre><code>   spe.only &lt;- data[,2:1521]
  </code></pre>
  <p>I then removed species which do not occur in any sample</p>
  <pre><code>   spe.only[, (!apply(spe.only==0,2,all))] 
  </code></pre>
  <p>I then ran Indicator species based on Groups (1) or (2)</p>
  <pre><code>  (iva &lt;- indval(spe.only, spe.grp$Groups))
  </code></pre>
  <p>But I get</p>
  <blockquote>
  <p>&quot;Error in indval.default(spe.only, spe.grp$Status) :    All species
  must occur in at least one plot&quot;</p>
  </blockquote>
  <p>How do I resolve this error so that I can run indval correctly?</p>