[R] Printing vectrix

K. Elo m@||||@t@ @end|ng |rom pp@|net@||
Mon Mar 25 08:25:31 CET 2019


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



More information about the R-help mailing list