I would like to determine the max the values in column value1
based the values in column value2
:
df <- 'inf value1 value2
xx1 20 30
xx2 15 40
xx3 25 20'
df <- read.table(text=df, header=T)
My expected output would be like that:
out <- 'inf value1 value2
xx1 20 30
xx2 15 40
xx3 20 20'
out <- read.table(text=out, header=T)
In the third row in the column value2
now I have 20
instead 25
, because this is the value at value2
column at the same row. I have a large dataset, I would appreciate any ideas to deal with that. Thank you!
Aucun commentaire:
Enregistrer un commentaire