tidy/efficient function writing in R
        Posted  
        
            by romunov
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by romunov
        
        
        
        Published on 2010-05-18T09:53:42Z
        Indexed on 
            2010/05/18
            10:10 UTC
        
        
        Read the original article
        Hit count: 347
        
r
|memory-efficient
Excuse my ignorance, as I'm not a computer engineer but with roots in biology. I have become a great fan of pre-allocating objects (kudos to SO and R inferno by Patrick Burns) and would like to improve my coding habits. In lieu of this fact, I've been thinking about writing more efficient functions and have the following question.
Is there any benefits in removing variables that will be overwritten at the start of the next loop, or is this just a waste of time? For the sake of argument, let's assume that the size of old and new variables is very similar or identical.
© Stack Overflow or respective owner