[R] inserting columns in the middle of a dataframe

Christos Hatzis christos at nuverabio.com
Thu Sep 14 00:22:29 CEST 2006


See ?append

-Christos 

-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Jon Minton
Sent: Wednesday, September 13, 2006 5:14 PM
To: r-help at stat.math.ethz.ch
Cc: 'Jon Minton'
Subject: Re: [R] inserting columns in the middle of a dataframe

Dear R users:

 

Is there a built-in and simple way to insert new columns after other columns
in a dataframe?

 

I.e. currently I have:

 

V1 V2 V3 V4

[1,]

[2,]

Etc.

 

But I want 

                V1 V5 V2 V3 V4

[1,] 

[2,]

Etc.

 

Can this be done in one line?

 

Jon Minton

 

 


	[[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.



More information about the R-help mailing list