[R] Altering columns

David Winsemius dwinsemius at comcast.net
Thu Jun 18 22:23:12 CEST 2009


mat[ , 2:1]

On Jun 18, 2009, at 4:14 PM, RON70 wrote:

>
> Hi,
>
> Suppose I have following dataset :
> mat <- matrix(rnorm(100), 50)
>
> Now I want to put 2nd column in the place of 1st and 1st column in  
> the place
> of 2nd. Is there any "quick" way to do that?
>
> Thanks and regards,
>
> -- 
> View this message in context: http://www.nabble.com/Altering-columns-tp24099597p24099597.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org 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.

David Winsemius, MD
Heritage Laboratories
West Hartford, CT




More information about the R-help mailing list