[R] Removing Rows/Records from a Table

Peter Lauren peterdlauren at yahoo.com
Sat Apr 15 17:19:20 CEST 2006


I would like to selectively remove rows from a table. 
I had hoped that I could create a table and
selectively add rows with something like
> NewTable<-table(nrow=100, ncol=4)
> NewTable[1,]<-OldTable[10,]

but that doesn't work.  The former call gives
> NewTable
     ncol
nrow  4
  100 1
while the latter call gives a table the length of
OldTable.   Making a matrix, m,  with the desired
table entries and doing
>NewTable-table(m)
also doesn't work.

Can anyone suggest the best way for me to do what I
want to do?

Many thanks in advance,
Peter Lauren.




More information about the R-help mailing list