[R] manipulating arrays

Rolf Turner r.turner at auckland.ac.nz
Sat Jul 28 00:34:48 CEST 2007


?append

	cheers,

		Rolf Turner

On 28/07/2007, at 2:12 AM, Henrique Dallazuanna wrote:

> Hi, I don't know if is the more elegant way, but:
>
> X<-c(1,2,3,4,5)
> X <- c(X[1], 0, X[2:5])
>
>
> --  
> Henrique Dallazuanna
> Curitiba-Paraná-Brasil
> 25° 25' 40" S 49° 16' 22" O
>
> On 27/07/07, Nair, Murlidharan T <mnair at iusb.edu> wrote:
>>
>> Can I insert an element in an array at a particular position without
>> destroying the already existing element?
>>
>>
>>
>> X<-c(1,2,3,4,5)
>>
>>
>>
>> I want to insert an element between 1 and 2.
>>
>>
>>
>> Thanks ../Murli
>>
>>
>>
>>
>>         [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting- 
> guide.html
> and provide commented, minimal, self-contained, reproducible code.

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



More information about the R-help mailing list