Re: [R] code optimization problem ... using or not using "which"function

2009-05-29 Thread krzysztof . sakrejda
Why not use the 'merge' function? Krzysztof Sent via BlackBerry by AT&T -Original Message- From: jim holtman Date: Fri, 29 May 2009 20:55:12 To: Juan Carlos Laguardia Cc: Subject: Re: [R] code optimization problem ... using or not using "which" functi

Re: [R] code optimization problem ... using or not using "which" function

2009-05-29 Thread jim holtman
For a start, do all your conversions to character and Date once outside the loop so you are not doing them for each iteration. Not exactly sure what you are doing, but it looks like with the 'and's you are only checking for the rows that are the same. You might want to use a 'match' function like

[R] code optimization problem ... using or not using "which" function

2009-05-29 Thread Juan Carlos Laguardia
hello all, I have two data sets that share certain fields of of interest ( facility, unit, date) which I want to match up, and from this extract information from one dataset and store it in the other. my first initial idea (which I know is bad) goes like this: ## capacity and new_trayloc are