Hi! 2019-03-25 kello 09:30 +0800, Steven Yen wrote: > The second command is ugly. How can I print the 25 numbers into 2 > rows > of ten plus a helf row of 5? Thanks.
Something like this? x<-1:25; for (i in seq(1,length(x),10)) print(x[i:ifelse((i+9)>length(x),length(x),i+9)]) HTH, Kimmo ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.