-- Per record functions. -- calls the R function of the same name as the Postgres function, i.e. gamma CREATE FUNCTION gamma(float8) RETURNS float8 AS '' LANGUAGE 'pl_R'; -- calls the function defined in the AS clause. CREATE FUNCTION myGamma(float8) RETURNS float8 AS 'gamma' LANGUAGE 'pl_R'; -- calls the function defined in the AS clause. CREATE FUNCTION gamma100(float8) RETURNS float8 AS 'function(x) { gamma(x/100)}' LANGUAGE 'pl_R'; -- returns a string by calling the function defined in the AS clause. CREATE FUNCTION rtext_dup(text) RETURNS text AS 'function(x) {paste(x, x)}' LANGUAGE 'pl_R'; CREATE FUNCTION rsum2(float8, float8) RETURNS text AS 'function(x,y) {x+y}' LANGUAGE 'pl_R'; CREATE FUNCTION rsum4(float8, float8, float8, float8) RETURNS text AS 'sum' LANGUAGE 'pl_R'; -- Arrays. CREATE FUNCTION rnorm(int4) RETURNS _float8 AS '' LANGUAGE 'pl_R'; CREATE FUNCTION objects(int4) RETURNS _text AS '' LANGUAGE 'pl_R';