Skip to content
Prev 349654 / 398513 Next

From replicate to accesing sublists

On Apr 1, 2015, at 9:59 PM, Alaios wrote:
You are still replying with formatted email. This mailing list attempts to be an HTML-free zone.
I don't think we can answer that unless we have a better understanding of the goals of this effort and the uses to which the data will be put.

If you used apply() you could work on an entire row or column at a time.

You could disguise the loop with no gain in time efficiency with sapply().

Shadows <- sapply(error_suburban_0, "[[", 'Shadowing') # saves you the typing effort of not calculating the length of the object; cleaner syntax.

There is a misconception that refuses to die, despite being smacked down many,many times on Rhelp, that loops in R are inefficient. It is usually the algorithm inside the loop that is inefficient.