0

I have the following type of dataset:

date         Company1_Value1     Company1_Value2 Company2_Value1  Company2_Value2  
01/01/15       a                        d              g              j
02/01//15 .    b                        e              h              k
03//01/15 .    c                        f              i              l
...

An I would like to reshape it like this :

Company_number  date           value1           value2
1                 01/01/15       a                d
1                 02/01/15       b                e
1                 03/01/15       c                f
2                 01/01/15       g                j
2                 02/01/15       h                k
2                 03/01/15       i                l

I have tried some transpose from the library data.table but with no success so far. Any ideas?

The code I used so far: library(data.table) df <- transpose(df)

I have been scrolling the web for a while and I found no R package or no one that had a similar issue for the moment.

Thank you a lot for your help !

0 Answers0