[R] Want to exclude a column when using sample function

Addi Wei addiwei at gmail.com
Wed Jul 14 19:17:02 CEST 2010


      id pID50      apol     a_acc    a_acid     a_aro a_base   a_count
1 mol.11  3.63 -0.882267 -0.527967 -0.298197 -1.032380      0 -1.063410
2 mol.14  3.38 -1.007330 -0.527967 -0.298197 -1.032380      0 -1.063410
3 mol.19  3.18  1.153560  1.407910 -0.298197  1.254100      0  1.160080
4 mol.20  3.14  0.183448 -0.527967 -0.298197  0.873019      0  0.290021
5 mol.29  2.77 -0.273901 -0.527967 -0.298197  0.110860      0 -0.193347
6 mol.30  2.74 -0.230593 -0.527967 -0.298197  0.110860      0  0.000000
7 mol.40  2.16 -1.117550 -0.527967 -0.298197 -1.032380      0 -1.256760
8 mol.45  1.90 -0.383560 -0.527967 -0.298197  0.110860      0 -0.290021
9 mol.48  1.73 -0.383560 -0.527967 -0.298197  0.110860      0 -0.290021


What if I want to exclude 2 columns?   
For example:   sample(data, 3, replace=FALSE)     ##from my sample, i want
to exclude both id and pID50

Thanks much.  
-- 
View this message in context: http://r.789695.n4.nabble.com/Want-to-exclude-a-column-when-using-sample-function-tp2287988p2289092.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list