// globals
var p;


function calculate () {
		p = "c (" + preg_replace ("/[, ]+/", ", ", getValue ("p")) + ")";

echo ('result <- (qgeom (p = ' + p + ', prob = ' + getValue ("prob") + ', ' + getValue ("tail") + ', ' + getValue("logp") + '))\n');
}

function printout () {
echo ('rk.header ("Geometric quantile", list ("Vector of probabilities", "' + p + '", "Probability of success in each trial", "' + getValue ("prob") + '", "Tail", "' + getValue ("tail") + '", "Probabilities p are given as", "' + getValue ("logp") + '"))\n');
echo ('rk.results (result, titles="Geometric quantiles")\n');
}

