Wednesday, 10 March 2010

Append to a vector in regular intervals efficiently in R

In many instances one may need to append a character or a value in a given sequence, usually represented as a vector or array. It is pretty easy to achieve this naively. However, the point is not to consume any more memory. This is one of the simple solutions I can propose in GNU R. # This function appends a word into vector a in every f elementappendfreq