Skip to content

Instantly share code, notes, and snippets.

@benizar
Created October 11, 2013 11:05
Show Gist options
  • Save benizar/6933005 to your computer and use it in GitHub Desktop.
Save benizar/6933005 to your computer and use it in GitHub Desktop.
This code creates a pl/R function for creating texture triangles directly from a PostgreSQL database.This example is composed by three pl/R files (_plr_clasif_textural_usage.sql, _plr_clasif_textural.sql and _plr_clasif_textural.R). This code is quite old and it would look better using the "The Soil Texture Wizard" package. Want more info? Visit…
-- Function: _plr_clasif_textural(text, text, text, text, text, text)
-- DROP FUNCTION _plr_clasif_textural(text, text, text, text, text, text);
CREATE OR REPLACE FUNCTION _plr_clasif_textural(text, text, text, text, text, text)
RETURNS text AS
$BODY$
--
--Put the R code here
--
$BODY$
LANGUAGE 'plr' VOLATILE
COST 100;
ALTER FUNCTION _plr_clasif_textural(text, text, text, text, text, text) OWNER TO postgres;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment