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
Post a Comment