I have 150 stops (Cod) and each one of this have a number of service that used.
| Cod | SERVICE1 | SERVICE2 | SERVICE3 | Position
------------------------------------------------------
| P05 | XRS10 | XRS07| XRS05| 12455
| R07 | FR05 | | | 4521
| X05 | XRS07 | XRS10| | 57541
I need to put all the services (SERVICE1,SERVICE2,SERVICE3) in one column. That means that I need the following result.
| Cod | SERVICE | Position
------------------------------------------------------
| P05 | XRS10 | 12455
| P05 | XRS07 | 12455
| P05 | XRS05 | 12455
| R07 | FR05 | 4521
| X05 | XRS07 | 57541
| X05 | XRS10 | 57541
There is any way to do this using the sqldf
package of R. Or any kind of way to do it?