[R] inserting elements in a list

About this list Date view Thread view Subject view Author view Attachment view

From: Agustin Lobo (alobo@ija.csic.es)
Date: Tue 18 Feb 2003 - 00:01:47 EST


Message-id: <Pine.OSF.3.91.1030217133410.1061D-100000@paleo>


I've searched the doc for insert
and could not find the way to do the following,
hope someone can help:

Let's say we have a vector:
> a
[1] "1" "2" "3" "5" "6" "3"

and we want to insert a "7" after
any given "3", i.e., we want vector a
to become:

[1] "1" "2" "3" "7" "5" "6" "3" "7"

That is, how can we replce one
element by more than one elements?
(...causing the vector to go beyond its
length)

Thanks

Agus

Dr. Agustin Lobo
Instituto de Ciencias de la Tierra (CSIC)
Lluis Sole Sabaris s/n
08028 Barcelona SPAIN
tel 34 93409 5410
fax 34 93411 0012
alobo@ija.csic.es

______________________________________________
R-help@stat.math.ethz.ch mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Tue 01 Jul 2003 - 09:11:22 EST