Skip to content
Prev 201676 / 398503 Next

Insert elements into a vector in a defined positions

On 26/11/2009, at 10:46 AM, Manuel Ramon wrote:

            
At first I thought append() might work ... but the "after"
argument to append seems to have to be of length 1.

How about:

	z2 <- numeric(length(z1)+length(id))
	z2[id] <- NA
	z2[!is.na(z2)] <- z1

A bit kludgy, but it appears to work.

	cheers,

		Rolf Turner

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}