Message-ID: <Pine.A41.4.61b.0411220804500.234728@homer05.u.washington.edu>
Date: 2004-11-22T16:10:54Z
From: Thomas Lumley
Subject: How to insert one element into a vector?
In-Reply-To: <41A20905.3000405@lancaster.ac.uk>
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