n<-length(letters) for(i in 1:n){ cat(letters[i]) if(i%%5==0) cat("\n") }