title: How to select multiple columns in df and bind under existing columns using dyplr
body: <p>I have a data frame with 3 columns per person: ID, time (in 10 mins bins), and binsleep (whether the person is awake=0 or asleep =1). I have multiple persons but each of their 3 columns are next to the previous person, giving me a wide df format. I need to put each person underneath each other, hence I would like to select columns id,time, binsleep and move them from the right side underneath the first person, so that I end up with a long df.</p>
  <p>This is what I have:</p>
  <pre><code>binsleep_wide &lt;- read.csv(&quot;example_data.csv&quot;, header = TRUE, na.strings = &quot;n/a&quot;)
  binsleep_wide 
  ID time binsleep ID.1 time.1 binsleep.1 ID.2 time.2 binsleep.2 ID.3 time.3 binsleep.3
  1  1    0        0    2      0          1    3      0          0    4      0          1
  2  1   10        0    2     10          1    3     10          0    4     10          1
  3  1   20        1    2     20          1    3     20          0    4     20          1
  4  1   30        1    2     30          1    3     30          0    4     30          0
  5  1   40        1    2     40          1    3     40          1    4     40          0
  6  1   50        0    2     50          1    3     50          1    4     50          0
  </code></pre>
  <p>And this is what I want:</p>
  <pre><code>    ID time binsleep
  1   1    0        0
  2   1   10        0
  3   1   20        1
  4   1   30        1
  5   1   40        1
  6   1   50        0
  7   2    0        1
  8   2   10        1
  9   2   20        1
  10  2   30        1
  11  2   40        1
  12  2   50        1
  13  3    0        0
  14  3   10        0
  15  3   20        0
  16  3   30        0
  17  3   40        1
  18  3   50        1
  19  4    0        1
  20  4   10        1
  21  4   20        1
  22  4   30        0
  23  4   40        0
  24  4   50        0
  </code></pre>
  <p>I tried using dplyr::gather() but the problem is that I don't have a common variable.</p>