Milton Huang wrote: > Thank you both for such beautiful solutions. Just what I was looking for! I > love the Internet, R, and the R-list! There is so much opportunity to learn. > > In fact, looking at the replace function, I see the two solutions are the > same: > > >> replace >> > function (x, list, values) > { > x[list] <- values > x > } > <environment: namespace:base> > >
not exactly. an application of replace generates a local copy of the data, and whatever you pass to replace as x will not be modified, while if you do the assignment yourself, you'll modify the data. > Thanks again. You made my day. Have a happy holiday season. > you too! meRRy chRistmas and a happy new yeaR to all subscRibeRs. vQ ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.