Reputation: 235
I'm trying to fill a matrix of 12 rows and 15 cols with the pair values(2,4,6,8,...) sort by row. I tried this command line:
x=c(2:2:360,nrow=12,ncol=15,byrow=TRUE)
But it gives me (2,3,4,5,6,7,8,9,...)
For a matrix of two rows and 5 cols:
[2, 4, 6, 8, 10
12, 14, 16, 18, 20]
Thank you
Upvotes: 0
Views: 66