r - How do I get which.max to return the row name and not an index number -


After the correlation has occurred, I want the row ID of the maximum value in each column. Which I am using. MAC but I can not find the name of the line. Instead I get an index number which is useless.

Apply

(my.data, 2, which.max) < P>>

  # Create an example data set .seed (1) df & lt; - data.frame (col1 = runif (100), col2 = runif (100)) row.names (df) & lt; # [1] "line 18" "row 4"    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -