title: Add column with numbers from 1 to 7 depending on the numbers of rows of data table
body: <p>How can I add a column to my data table (time series) that contains numbers from 1 to 7, depending on the number of rows? <strong>For example:</strong> My data table has 70 rows, then I would like to add a column that lists 10 times the 1, then 10 times the 2 etc. in succession. I need this column to color a plot where I have 7 colors available. The number of columns is always different, so adding the numbers from 1 to 7 should work according to the number of columns.
  My data table could look like this for example (but looks always different, as I get the data table from an external server):</p>
  <pre><code>set.seed(123)
  dt.data &lt;- data.table(date = seq(as.Date('2019-01-01'), by = '1 day', length.out = 365),
                        'Power' = rnorm(365, 30, 1), 'Gas' = rnorm(365, 10, 1),
                        'CO2' = rnorm(365, 40, 1), check.names = FALSE)
  </code></pre>
  <p>How can I add a new column, which contains (365/7 = 52,14) 52 times the number 1 then 52 times the number 2 ... up to 52 times number 7.</p>