split_n <- 20 split_row <-rep(1:split_n, rep(round(length(y)/split_n,0), split_n)) for(d in 1:split_n){ #d <- 1 tmp <- split(y, split_row)[[d]] # # ............. # }
charindex <- function(str1,str2,startpos=1,n=1){ aa=unlist(strsplit(substring(str1,startpos),str2)) if(length(aa) < n+1 ) return(0); return(sum(nchar(aa[1:n])) + startpos+(n-1)*nchar(str2) ) }