Re: [R] Delete row takes ages. alternative?!

2011-07-12 Thread sven
Thanks both of you for help! This is my conclusion based on Rolf's and David's suggestion: (x=data.frame) By for-looping over a data.frame and deleting certain rows with x=x[-i,] its better to collect all rows which need to be deleted in a vector and do one final delete step: collecting:

Re: [R] Delete row takes ages. alternative?!

2011-07-09 Thread David Winsemius
On Jul 9, 2011, at 7:02 PM, sven wrote: Hello, I am a student from Liverpool UK, working with some genetic data using R. I got a data.frame with about 250.000 rows and using a for loop to delete certain rows using the following code: x - is a data.frame x = x[-5,] --- deletes row 5

[R] Delete row takes ages. alternative?!

2011-07-09 Thread sven
Hello, I am a student from Liverpool UK, working with some genetic data using R. I got a data.frame with about 250.000 rows and using a for loop to delete certain rows using the following code: x - is a data.frame x = x[-5,] --- deletes row 5 x = x[-10,] --- delets row 10 x = x[-i,] --

Re: [R] Delete row takes ages. alternative?!

2011-07-09 Thread Rolf Turner
On 10/07/11 12:12, David Winsemius wrote: SNIP Uhhh, you meant drpidx - -c(5,10, i) x - x[-drpidx, ] cheers, Rolf Turner __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] Delete row takes ages. alternative?!

2011-07-09 Thread David Winsemius
On Jul 9, 2011, at 9:37 PM, Rolf Turner wrote: On 10/07/11 12:12, David Winsemius wrote: SNIP Uhhh, you meant drpidx - -c(5,10, i) x - x[-drpidx, ] Yes, I certainly did. Thanks for the correction. cheers, Rolf Turner David Winsemius, MD West Hartford, CT

Re: [R] Delete row takes ages. alternative?!

2011-07-09 Thread David Winsemius
On Jul 9, 2011, at 11:42 PM, David Winsemius wrote: On Jul 9, 2011, at 9:37 PM, Rolf Turner wrote: On 10/07/11 12:12, David Winsemius wrote: SNIP Uhhh, you meant drpidx - -c(5,10, i) x - x[-drpidx, ] Yes, I certainly did. Thanks for the correction. A little bird has tweeted that I