X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=tags%2Fgsoc_final%2FR%2Futil.R;fp=tags%2Fgsoc_final%2FR%2Futil.R;h=e10951e2afa40e4104354dbd421c17518f1b8de6;hb=5101cce1568b46d042316f32c8216e956f76ff65;hp=0000000000000000000000000000000000000000;hpb=1d3c6e2092b87a8e640704ce3ceec4e8ece3859e;p=cran2deb.git diff --git a/tags/gsoc_final/R/util.R b/tags/gsoc_final/R/util.R new file mode 100644 index 0000000..e10951e --- /dev/null +++ b/tags/gsoc_final/R/util.R @@ -0,0 +1,25 @@ +iterate <- function(xs,z,fun) { + y <- z + for (x in xs) + y <- fun(y,x) + return(y) +} + +chomp <- function(x) { + # remove leading and trailing spaces + return(sub('^[[:space:]]+','',sub('[[:space:]]+$','',x))) +} + +host_arch <- function() { + # return the host system architecture + system('dpkg-architecture -qDEB_HOST_ARCH',intern=T) +} + +err <- function(...) { + error(...) + exit() +} + +exit <- function() { + q(save='no') +}