On Mon, 2004-11-22 at 17:43, 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
suppose I want to insert 5 into the vector (1,2,3,4,6) between 4 and 6.
thx!
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
There must be a million ways of doing this!
If you want to keep the order:
v - c(1,2,3,4,6)
sort(c(v,5))
Mick
-Original Message-
From: jing tang [mailto:[EMAIL PROTECTED]
Sent: 22 November 2004 14:44
To: [EMAIL PROTECTED]
Subject: [R] How to insert one element into a vector?
suppose
michael watson (IAH-C) wrote:
There must be a million ways of doing this!
Actually I'd say there were no ways of doing this, since I dont think
you can actually insert into a vector - you have to create a new vector
that produces the illusion of insertion!
Here's a Q+D function that fails if
?append --- look at the `after' argument.
-roger
jing tang wrote:
suppose I want to insert 5 into the vector (1,2,3,4,6) between 4 and 6.
thx!
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting
On Monday 22 November 2004 09:19, Barry Rowlingson wrote:
michael watson (IAH-C) wrote:
There must be a million ways of doing this!
Actually I'd say there were no ways of doing this, since I dont
think you can actually insert into a vector - you have to create a
new vector that produces
Barry Rowlingson [EMAIL PROTECTED] writes:
michael watson (IAH-C) wrote:
There must be a million ways of doing this!
Actually I'd say there were no ways of doing this, since I dont
think you can actually insert into a vector - you have to create a new
vector that produces the illusion
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!
Python has separate insert and append methods for
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