ychu066
2009-Nov-18 03:19 UTC
[R] HOw to delete a row in the data matrix and change the order of the row ???
hi, i delete row 65,70,75 in my data data<- data[-c(65,70,75),] But i also want the order of the row to match up eg: 67 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 68 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 69 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 71 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 72 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 73 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 74 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 76 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 77 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 I dont want this , I don't want a gap between 69-71 , 73-74 and 74-76. i want it like this 67 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 68 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 69 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 70 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 71 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 72 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 73 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 74 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 75 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 please help me ... -- View this message in context: http://old.nabble.com/HOw-to-delete-a-row-in-the-data-matrix-and-change-the-order-of-the-row-----tp26401860p26401860.html Sent from the R help mailing list archive at Nabble.com.
Uwe Ligges
2009-Nov-18 07:56 UTC
[R] HOw to delete a row in the data matrix and change the order of the row ???
Assign new row names? Uwe Ligges ychu066 wrote:> hi, > > i delete row 65,70,75 in my data > data<- data[-c(65,70,75),] > > But i also want the order of the row to match up > eg: > > 67 1 1 1 1 1 1 1 1 1 1 1 1 1 1 > 1 > 68 1 1 1 1 1 1 1 1 1 1 1 1 1 1 > 1 > 69 1 1 1 1 1 1 1 1 1 1 1 1 1 1 > 1 > 71 1 1 1 1 1 1 1 1 1 1 1 1 1 1 > 1 > 72 1 1 1 1 1 1 1 1 1 1 1 1 1 1 > 1 > 73 1 1 1 1 1 1 1 1 1 1 1 1 1 1 > 1 > 74 1 1 1 1 1 1 1 1 1 1 1 1 1 1 > 1 > 76 1 1 1 1 1 1 1 1 1 1 1 1 1 1 > 1 > 77 1 1 1 1 1 1 1 1 1 1 1 1 1 1 > 1 > > I dont want this , I don't want a gap between 69-71 , 73-74 and 74-76. > > i want it like this > 67 1 1 1 1 1 1 1 1 1 1 1 1 1 1 > 1 > 68 1 1 1 1 1 1 1 1 1 1 1 1 1 1 > 1 > 69 1 1 1 1 1 1 1 1 1 1 1 1 1 1 > 1 > 70 1 1 1 1 1 1 1 1 1 1 1 1 1 1 > 1 > 71 1 1 1 1 1 1 1 1 1 1 1 1 1 1 > 1 > 72 1 1 1 1 1 1 1 1 1 1 1 1 1 1 > 1 > 73 1 1 1 1 1 1 1 1 1 1 1 1 1 1 > 1 > 74 1 1 1 1 1 1 1 1 1 1 1 1 1 1 > 1 > 75 1 1 1 1 1 1 1 1 1 1 1 1 1 1 > 1 > > please help me ... > >