title: fill matrix with numbers in each row to create a parttern
body: <p>I'm trying to generate a trip parttern using a matrix.</p>
  
  <pre><code>    Glastonbury Munich Venice Paris Ibiza Kamar-Taj
   [1,]           1      2      3     4     5         6
   [2,]           1      2      3     4     5         0
   [3,]           1      2      3     4     0         0
   [4,]           1      2      3     0     0         0
   [5,]           1      2      0     0     0         0
   [6,]           3      2      1     4     5         6
   [7,]           0      2      3     4     1         0
   [8,]           0      1      2     0     0         0
   [9,]           5      1      3     2     0         0
  </code></pre>
  
  <p>each row represents a single trip, and the number in a cell represents the order they visited each locations. Zero means they didn't visit that place. </p>
  
  <p>currently I'm creating it like this:</p>
  
  <pre><code>tripMatrix &lt;- list()
  
  tripMatrix[[ 1 ]] &lt;- c(1, 2, 3, 4, 5, 6)
  tripMatrix[[ 2 ]] &lt;- c(1, 2, 3, 4, 5, 0)
  tripMatrix[[ 3 ]] &lt;- c(1, 2, 3, 4, 0, 0)
  tripMatrix[[ 4 ]] &lt;- c(1, 2, 3, 0, 0, 0)
  tripMatrix[[ 5 ]] &lt;- c(1, 2, 0, 0, 0, 0)
  tripMatrix[[ 6 ]] &lt;- c(3, 2, 1, 4, 5, 6)
  tripMatrix[[ 7 ]] &lt;- c(0, 2, 3, 4, 1, 0)
  tripMatrix[[ 8 ]] &lt;- c(4, 5, 3, 2, 1, 0)
  tripMatrix[[ 8 ]] &lt;- c(0, 1, 2, 0, 0, 0)
  tripMatrix[[ 10 ]] &lt;- c(5, 1, 3, 2, 0, 0)
  
  trips &lt;- matrix(unlist(tripMatrix), ncol = 6, byrow = TRUE)
  </code></pre>
  
  <p>I can only do this for a few rows,  but I'll like to generate N number of rows with different conbinations of places visited during a trip.</p>
  
  <p>Please I can I do this for N number of rows without  having to manually create a list of trips?</p>