how to put samples in same order while using tidyverse

So actually , I want to put samples in same order in both files; betaval and targets

> head(betaval, 10) [,1:5]
# A tibble: 10 × 5
   ``          DC115  DC103  DC122  DC118
   <chr>       <dbl>  <dbl>  <dbl>  <dbl>
 1 cg26928153 0.929  0.862   0.680 0.890 
 2 cg16269199 0.836  0.604   0.589 0.679 
 3 cg13869341 0.826  0.830   0.704 0.786 
 4 cg24669183 0.768  0.810  NA     0.765 
 5 cg26679879 0.388  0.428   0.438 0.344 
 6 cg22519184 0.412  0.445   0.391 0.345 
 7 cg15560884 0.640  0.551  NA     0.676 
 8 cg01014490 0.0207 0.0290  0.148 0.0226
 9 cg10692041 0.916  0.828  NA     0.847 
10 cg02339369 0.933  0.939  NA     0.892

> head(targets, 10) [,1:5]
# A tibble: 10 × 5
   ``    Sentrix_ID   Sentrix_Position Barcode             Batch   
   <chr> <chr>        <chr>            <chr>               <chr>   
 1 DC103 202915600062 R07C01           202915600062_R07C01 Batch 13
 2 DC115 202915600134 R02C01           202915600134_R02C01 Batch 15
 3 DC118 202995640096 R04C01           202995640096_R04C01 Batch 7 
 4 DC122 202915600016 R06C01           202915600016_R06C01 Batch 18
 5 DC124 202915600134 R05C01           202915600134_R05C01 Batch 15
 6 DC126 202915590071 R05C01           202915590071_R05C01 Batch 14
 7 DC127 202915590071 R02C01           202915590071_R02C01 Batch 14
 8 DC131 202995640096 R08C01           202995640096_R08C01 Batch 7 
 9 DC133 202915600085 R02C01           202915600085_R02C01 Batch 14
10 DC139 200848860168 R02C01           200848860168_R02C01 Batch 5

Many thanks

I think you should pivot betaval longer

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.