title: My programme is showing the following error: 'argument 'length.out' must be of length 1'. I do not think I have made any mistake
body: <p>I am creating a data for a model in ecology which is called as random fraction model.
  The programme for the model:</p>
  
  <pre><code>    RelAbund&lt;-randomfraction(3,1000)
  </code></pre>
  
  <p>Its output is:</p>
  
  <pre><code>    RelAbund
        [,1]        [,2]
      [1,] 0.6083835 0.004510276
      [2,] 0.2792227 0.003305510
      [3,] 0.1123938 0.002514014
  </code></pre>
  
  <p>Now I want to create data using the first column of this matrix. 
  I am storing this data in a list called 'Data'.
  It is a list of vectors. The vectors contain consecutive +ve numbers.
  e.g. vector1 is (1,2,3,4,5)
       vector2 is(6,7,8,9,10,11,12,13)
       &amp; so on. 
  Now the programme I have written to create the data is as follows:</p>
  
  <pre><code>    CreateData&lt;-function(nind,nspec)  
      RelAbund&lt;-randomfraction(nspec,1000)                                                                                      
      Data&lt;-list()
      Datavector&lt;-c()
      individuals&lt;-c(0)
      for(ii in 1:nspec-1){
      **individuals&lt;-seq(length.out=RelAbund[ii,1]*nind,from=tail(individuals,n=1)+1,by=1)** 
      Data&lt;-lappend(Data,individuals)
      }
      Datavector&lt;-seq(length=nind-(tail(tail(Data,n=1),n=1)),from=tail(tail(Data,n=1),n=1)+1,by=1)
      Data&lt;-lappend(Data,Datavector)
      return(Data)
      }
  </code></pre>
  
  <p>The starred line is showing error:</p>
  
  <p>Error is as follows:</p>
  
  <pre><code>    Error in seq.default(length.out = RelAbund[ii, 1] * nind, from = tail(individuals,  : argument 'length.out' must be of length 1
  </code></pre>
  
  <p>nind is an integer.
  Acc to me the argument length.out is already of length 1. 
  Then why is it showing this error??</p>