I want to do a simple task and can not figure out how. I have a dataframe (data.table in fact) similar to this:
date code1
2015-03-01 A
2015-03-02 A
2015-03-03 A
2015-03-01 B
2015-03-02 B
2015-03-03 B
and I want a new column with the date order by code1 as follows:
date code1 order
2015-03-01 A 1
2015-03-02 A 2
2015-03-03 A 3
2015-03-01 B 1
2015-03-02 B 2
2015-03-03 B 3
thanks in advance.