X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=branch%2Fmultisys%2FR%2Futil.R;fp=branch%2Fmultisys%2FR%2Futil.R;h=68401fd2137a1aac76bb0fe6845e611ccab900e8;hb=413d9e15b7bd5f8f36685c2cccbb9bbed3a3a0b9;hp=0000000000000000000000000000000000000000;hpb=65fce8cd87d7d6f0209611ff7a264819e42a6c9e;p=cran2deb.git diff --git a/branch/multisys/R/util.R b/branch/multisys/R/util.R new file mode 100644 index 0000000..68401fd --- /dev/null +++ b/branch/multisys/R/util.R @@ -0,0 +1,20 @@ +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))) +} + +err <- function(...) { + error(...) + exit() +} + +exit <- function() { + q(save='no') +}