Guest User

Untitled

a guest
Sep 19th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. Mytextsample <- "aaaaabb cccdddd eee adssdada ooeoeo ososs ksdkd
  2. ooeresso osososososos krrr dkdkkd odlcjs kdcmcmc ddddd dmssss"
  3.  
  4. dat <- unlist(strsplit(Mytextsample, " ")) # unlist is here to convert to a vector
  5. dat <- split(dat, ceiling(seq_along(dat)/10))
  6.  
  7. out <- sapply(dat, function(x) paste0(x, collapse = " "))
  8. out
Add Comment
Please, Sign In to add comment