0

I would like to achieve this result: - The variable v is copied in sequence every 3 - Each subsequent sequence is in the next row - The variable variables var1-var4 are appended to each subsequent sequence

Input data

name_a     var_1    var_2    var_3    v1    v2    v3    v4    v5     v6
vw    diesel    1600    black    technican    repair_mech    30    diagnostic    repair_test    80
audi    gasoline    1200    red    technican    repair_mech    40    expert    repair_test    120

I would like to receive such a result.

name_a    var_1    var_2    var3   vA    vB    Vc
vw    diesel    1600    black    technican    repair_mech    30
vw    diesel    1600    black    diagnostic    repair_test    80
audi    gasoline     1200    red    technican    repair_mech    40
audi    gasoline     1200    red    expert    repair_test    120

Thanks for the help in advance. With a large number of variables in Excel, this cannot be done.

John Coleman
  • 51,337
  • 7
  • 54
  • 119
Peter
  • 29
  • 4
  • Why do you mention Excel in an R question? The question isn't very clear and the data is not easy for others to reproduce. It would help if you show your attempts and discuss the problems that you are having with them. Please provide a [mcve]. See [How to make a great R reproducible example?](https://stackoverflow.com/q/5963269/4996248) for what this would mean in R. – John Coleman Nov 30 '19 at 12:53
  • This is a reshape wide to long question. See also https://stackoverflow.com/questions/12466493/reshaping-multiple-sets-of-measurement-columns-wide-format-into-single-columns – Cole Nov 30 '19 at 13:02

0 Answers0