I have 9 different daily variables (share price, bid price, ask price, shares
outstanding, etc...) for appr. 900 companies over 2 years. In the first
column is the date, and then the following 9 columns are the 9 variables for
the first firm (price1, bid price1, ask price1,...), followed by the
variables for the 2nd firm (price2, bid price2, ask price2,...) etc...

I want to shape the data into the long format with the first column as the
date, second column as the firm number and then the 9 variables.

I have already tried it with the gather() function and have 4 columns now
with the date, firm number, variable and the value. But I don“t know how to
shape it that I get the 9 variables into 9 columns?

Thanks a lot for any help.



--
View this message in context: 
http://r.789695.n4.nabble.com/Data-shape-from-wide-to-long-tp4731342.html
Sent from the datatable-help mailing list archive at Nabble.com.
_______________________________________________
datatable-help mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

Reply via email to