Postgres Function Select Into Arraylist Sort Function In R