I want to a maximum value per rowname(1, 2, or A, B..) per multiple columns(samples).
I have a matrix.
id sample1 sample2 sample3 ...
1 16498 2416 12555.5
1 21282.5 3342 22202
2 18558 2308 na
2 17966 3047 na
2 398 176.5 na
3 347 227 201.5
3 604.5 284.5 300
3 517.5 283.5 330.5
3 3709 2338 5709
4 1 2 1
...
and then,
id sample1 sample2 sample3 ...
1 21282.5 3342 22202
2 18558 3047 na
3 3709 2338 5709
4 1 2 1
...
Please give me some advice on this problem. Thanks in advance!!
Try
Or
NOTE: I am guessing you have real
NAs
in the datasetdata