search for: strsplit2

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

Did you mean: strsplit
2010 Mar 29
3
one way to write scripts in R
..."\t") if (length(w)) { x[w]=substr(x[w],2,n[w]) } x } # eliminate whitespace leading/trailing from a string trim=function(x) { y=chomp(x) while(any(y!=x)) { x=y y=chomp(x) } y=prechomp(x) while(any(y!=x)) { x=y y=prechomp(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,...) { i...