title: Convert tibble to long form when the variables consist of several parts
body: <p>I have such data</p>
  <pre><code>library(tidyverse)
  
  df = tribble(
    ~id, ~a1, ~a2, ~a3, ~b1, ~b2, ~b3, ~c1, ~c2, ~c3,
      1,   1,   4,   7,  11,  14,  17,  21,  24,  27,
      2,   2,   5,   8,  12,  15,  18,  22,  25,  28,
      3,   3,   6,   8,  13,  16,  19,  23,  26,  29,
  )
  </code></pre>
  <p>I would like to convert it to a long form, where the variable names contain two parts name (a, b, c) and number (1, 2, 3) which should become new variables in the long version of the table as below.</p>
  <pre><code>   id name nr data
  1   1    a  1    1
  2   2    a  1    2
  3   3    a  1    3
  4   1    a  2    4
  5   2    a  2    5
  6   3    a  2    6
  7   1    a  3    7
  8   2    a  3    8
  9   3    a  3    8
  10  1    b  1   11
  11  2    b  1   12
  12  3    b  1   13
  13  1    b  2   14
  14  2    b  2   15
  15  3    b  2   16
  16  1    b  3   17
  17  2    b  3   18
  18  3    b  3   19
  19  1    C  1   21
  20  2    C  1   22
  21  3    C  1   23
  22  1    C  2   24
  23  2    C  2   25
  24  3    C  2   26
  25  1    C  3   27
  26  2    C  3   28
  27  3    C  3   29
  </code></pre>
  <p>Can it be done simply by using the functions in the <code>dplyr</code> package? I tried the <code>pivot_longer</code> effect was disappointing.</p>
  <p>Any prompts are welcome.</p>