Re: [R] delete lines

2009-08-06 Thread Henrique Dallazuanna
Try this: m[!apply(m < 0, 1, any),] On Thu, Aug 6, 2009 at 9:57 AM, Inchallah Yarab wrote: > Hi , > > I need to write a function to delete a row if the value of one element of > the row is negatif!!! > I have a big file of data and i will check every lines!!! > > Any ideas > Thank you !! > > > >

Re: [R] delete lines

2009-08-06 Thread Sarah Goslee
# identify rows with only positive values mydata.index <- apply(mydata, 1, function(x)all(x >= 0)) # create a new data frame/matrix with only those rows mydata.pos <- mydata[mydata.index,] Sarah On Thu, Aug 6, 2009 at 8:57 AM, Inchallah Yarab wrote: > Hi , > > I need to write a function to dele

[R] delete lines

2009-08-06 Thread Inchallah Yarab
Hi , I need to write a function to delete a row if the value of one element of the row is negatif!!! I have a big file of data and i will check every lines!!! Any ideas Thank you !! [[alternative HTML version deleted]] __ R-help@r-p