Skip to content
Prev 314638 / 398502 Next

non-consing count

On 4 January 2013 16:53, jim holtman <jholtman at gmail.com> wrote:
I think Sam's question was about additional memory introduced by which.

For example:
56 bytes
104 bytes


If you have very large vector, a time series for example. This would
make a lot of
difference. I am not sure how 'sum' internally handles, but  As I said
earlier, a special function
in C might be faster then length-which couple or sum, that counts
occurrences as it goes, so it could
get the result in one go, maybe like  x %count% 0. One can implement a
recursive function
to do this in R interpreter level, but not sure about recursion depth
memory requirement.