How to insert one element into a vector?
On Mon, 22 Nov 2004, Barry Rowlingson wrote:
Deepayan Sarkar wrote:
Pretty much what 'append' does.
A shame then, that help.search("insert") doesn't find 'append'! I cant think
why anyone looking for a way of _inserting_ a value in the middle of a vector
would think of looking at "append"!
Yes, this should be fixed.
Python has separate insert and append methods for vectors.
I don't think this is a good idea unless there are efficiency issues.
You could always define one: the definition is fairly simple.
insert<-append
-thomas