After I did a cast function with the original data table I've got the matrix which looks like this (just a sample of it)
ctime 01/13 01/14 02/13 02/14
01/13 10003 2057 11830 1061
01/14 0 3722 0 4088
02/13 0 1485 4765 1267
02/14 0 0 0 3810
03/13 0 5268 0 4829
this is the amount of users transactions in the month with column's name, who came in the month of ctime column. Like for example, users who came in January-13 paid 10003 times in the January-13, but, after a year in January-14 the same users (who hasn't left the game) paid 2057 times.
The matrix now is in data frame format with characters inside.
I want to have matrix like this
ctime 01/13 02/13 01/14 02/14
01/13 100038 115830 20573 18061
02/13 0 47065 14385 12637
03/13 0 0 54268 48029
01/14 0 0 37282 42088
02/14 0 0 0 38910
Can you please give me a tip, how can I order the matrix by ctime column and by rows please?