Skip to content
Prev 181905 / 398513 Next

code optimization problem ... using or not using "which"function

Why not use the 'merge' function?

Krzysztof

Sent via BlackBerry by AT&T

-----Original Message-----
From: jim holtman <jholtman at gmail.com>

Date: Fri, 29 May 2009 20:55:12 
To: Juan Carlos Laguardia<brassman785 at gmail.com>
Cc: <r-help at r-project.org>
Subject: Re: [R] code optimization problem ... using or not using "which"
	function


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:

x <- match(capacity$shift_dt, new_trayloc$admin)

to get where each of the items match and then when you have done it for the
three conditions, you then find columns that have the same number indicating
all condition match for that row.

On Fri, May 29, 2009 at 7:17 PM, Juan Carlos Laguardia <
brassman785 at gmail.com> wrote:

            

  
    
Message-ID: <108887377-1243645495-cardhu_decombobulator_blackberry.rim.net-1097137269-@bxe1124.bisx.prod.on.blackberry>
In-Reply-To: <644e1f320905291755y4ff16dcchb08fd216e8fd8449@mail.gmail.com>