Reshape dataframe wide to long format

54 Views Asked by At

I have a dataframe including around 2500 obs. of 500 variables. Here is the example: wide format

And here is what I want: long format

I would like to convert wide format to long format like the image above.

Is there a way to convert asset, liabilities, equality, etc. at once?

I succeeded in converting only asset to long format by referring to these sites:

http://www.cookbook-r.com/Manipulating_data/Converting_data_between_wide_and_long_format/

reshape dataframe from wide to long in R

But I don't know how to convert several variables at once.

0

There are 0 best solutions below