[R] arrangement

David Winsemius dwinsemius at comcast.net
Mon Apr 16 23:25:47 CEST 2012


On Apr 16, 2012, at 5:19 PM, Soheila Khodakarim wrote:

> Dear All
>
> I want to arrange our output in 3 columns in R.
> Example:
>
> N           04320        03010      00514   00604   00563        03430
> 03022
> V 22.000000 0.000000e+00 15.0000000 15.0000 13.0000 1.300000e+01  
> 51.0000000
> p  0.640625 2.910383e-11  0.4257812  0.4375  0.6875 3.356934e-04   
> 0.2434998
>
> N     03060       04140       03050      00562      00565
> V 20.0000000 62.00000000 273.0000000 265.000000 27.0000000
> p  0.2783203  0.07714844   0.1044959   0.163799  0.6523438
>
> arranged:
>
> N                    P                         V
> 04320          22.000000         0.640625
> 03010         0.000000e+00   2.910383e-11
>
> Is there any way to do it in R directly?

?t

(Type the above two character at your console.)

You may also need object[ , c(1,3,2)]


>
> Best Regards,
> Soheila
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> 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
West Hartford, CT



More information about the R-help mailing list