search for: keepsplit

Displaying 1 result from an estimated 1 matches for "keepsplit".

2010 Mar 29
3
one way to write scripts in R
...mp(x) } x } strsplit2=function(x,split,...) { # detect trailing split : and add "" afterwards, so we know if it was there. a=strsplit(pp(x,"|@|@|"),split,...) lapply(a,function(x) gsub("|@|@|","",x,fixed=TRUE)) } strsplit3=function(x,split,keepsplit=FALSE,...) { if (keepsplit) { repstring="34HERE43" if (length(grep(repstring,x))) { die(repstring, " repstring already found. Arg! Aborting") } # sanity check # note where we want to split, using \\1 backref to keep the original a=gsub(pattern=pp(&qu...