Ticket 3058: sort in R api