Postgres Create Function In R Programming