R/R_strCombine2.r

Defines functions strCombine2

#x=c("a","B","c")
    strCombine2=function(x,sep=" ") { # produce "a B c"
     n=length(x)
     y=paste(x[1])
     
     if(n==1) y=paste(x)
     
     if(n>1) {
     for (i in 2:n) { y= paste(y,x[i],sep=sep) }
     
     }
      y
     }
#strCombine2(c("aa","b","d"),"_")
     #strCombine2(c("aa","b","d"))

Try the CGEN package in your browser

Any scripts or data that you put into this service are public.

CGEN documentation built on April 28, 2020, 8:08 p.m.