X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=branch%2Fdouble_build%2FR%2Futil.R;fp=branch%2Fdouble_build%2FR%2Futil.R;h=68401fd2137a1aac76bb0fe6845e611ccab900e8;hb=bbe8a759637a74b5036c8c7345de55a96cb7bbd6;hp=0000000000000000000000000000000000000000;hpb=449efd24870d395eb1edfd4d3a59e239c8cc5547;p=cran2deb.git diff --git a/branch/double_build/R/util.R b/branch/double_build/R/util.R new file mode 100644 index 0000000..68401fd --- /dev/null +++ b/branch/double_build/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') +}