[R]

About this list Date view Thread view Subject view Author view Attachment view

From: volkswirt@gmx.net
Date: Tue 01 Apr 2003 - 00:41:48 EST


Message-id: <7451.1049121708@www25.gmx.net>

How can I remove all rows/collumns from a matrix that fulfill a certain
condition? For instance: remove all negative elements from a [n,1]-matrix.
I intended to write a function for this aim, but it does not work. Despite
that it may help to get my point, when I ad it:
  
kratek<-function(eine)
{
halt<-0
for(index in 1:dim(eine)[1])
{
if(eine[(index-halt),1]<=0)
{
eine<-eine[-(index-halt),]
halt<-halt+1
}
}
eine
}
 
Thank You in advance!

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Tue 01 Jul 2003 - 09:11:33 EST