[R] how to remove one row at a time from a matrix keeping its nrow consistent

2010-04-17 Thread mauede
After some headache with debugging my script, I finally isolated the problem taht I am going to illustrate in the following example. I expected matrix nrow to decrease consistently till 1. Instead, when the matrix is left with one row only, its nrow jumps to 2 because the matrix gets

Re: [R] how to remove one row at a time from a matrix keeping its nrow consistent

2010-04-17 Thread Ista Zahn
On Sat, Apr 17, 2010 at 7:25 PM, mau...@alice.it wrote: After some headache with debugging my script, I finally isolated the problem taht I am going to illustrate in the following example. I expected matrix nrow to decrease consistently till 1. Instead, when the matrix is left with one row

Re: [R] how to remove one row at a time from a matrix keeping its nrow consistent

2010-04-17 Thread Henrique Dallazuanna
Try this indeed of as.matrix(...) : B - B[-1,, drop = FALSE] On Sat, Apr 17, 2010 at 3:25 PM, mau...@alice.it wrote: After some headache with debugging my script, I finally isolated the problem taht I am going to illustrate in the following example. I expected matrix nrow to decrease

Re: [R] how to remove one row at a time from a matrix keeping its nrow consistent

2010-04-17 Thread David Winsemius
On Apr 17, 2010, at 2:25 PM, mau...@alice.it wrote: After some headache with debugging my script, I finally isolated the problem taht I am going to illustrate in the following example. I expected matrix nrow to decrease consistently till 1. Instead, when the matrix is left with one row