I am trying to sort a very large dataset that includes id numbers and timestamps. There are multiple rows with the same ID number and therefore I need the corresponding timestamps to be in datetime order. I have tried both the base order() and the dplyr arrange() functions. Example of the base order() function code:
> df[with(df, order("deviceNr", "timestamp"))]
This code seemed to remove all parts of the dataset and produced two columns of ascending numbers
Example of the dplyr arrange() function code:
> arrange(df, "deviceNr", "timestamp")
This code arranged only by deviceNr (the ID), but not by timestamp