R/transpose.R

Defines functions transpose

transpose <- function(string){
  len <- nchar(string)
  i<-1:(len-1)
  bucket<-c()
  bucket<-append(bucket,unique(as.vector(sapply(string, function(x) paste0(str_sub(string,1,i-1),str_sub(string,i+1,i+1),str_sub(string,i,i),str_sub(string,i+2,nchar(string)))))))
  bucket
}

Try the TSTr package in your browser

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

TSTr documentation built on May 1, 2019, 9:16 p.m.