R sorting data from UCLA