[R] Moving 2nd column into 1st column using R
drj|m|emon @end|ng |rom gm@||@com
Tue Sep 10 06:34:02 CEST 2019
You might be surprised.
On Tue, Sep 10, 2019 at 12:20 PM smart hendsome via R-help
<r-help using r-project.org> wrote:
> Hi R-user,
> I have a problem regarding R. How can I move my 2nd column into 1st column. For example I have data as below:
> mydf <- data.frame(matrix(1:6, ncol = 2))
> X1 X2 1 4 2 5 3 6
> I want move my 2nd column become like this:
> X1 1 2 3 4 5 6
> Hope anyone can help me. Many thanks.
> [[alternative HTML version deleted]]
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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