[R] split data frame temporary and work with only part of it?

ivo welch ivo.welch at gmail.com
Sun Jul 24 19:07:23 CEST 2011


dear R wizards:  I have a large data frame, a million rows, 40
columns.  In this data frame, there are some (about 100,000) rows
which I want to recompute (update), while I want to leave others just
as is.  this is based on a condition that I need to compute, based on
what is in a few of the columns.  what is the right R way to do this?

I could subset out the rows that I want to recompute into a new data
frame (A), subset out the rows I don't want to recompute (B), operate
on the first data frame (A), then rbind the two (A and B) back
together and resort into original order.  is this the recommended way?

sincerely,

/iaw
----
Ivo Welch (ivo.welch at gmail.com)



More information about the R-help mailing list