Postgres Window Functions Row Number In R