Get the value of the max within row
data %>% mutate(row.max_val = do.call(pmax, (.)))
Get the argmax within row
data %>% mutate(row.argmax = names(.)[max.col(.)])
data %>% mutate(row.max_val = do.call(pmax, (.)))
data %>% mutate(row.argmax = names(.)[max.col(.)])
本文标题:dplyr-获取行最大值与行最大值对应的索引列
本文链接:https://www.haomeiwen.com/subject/okavcdtx.html
网友评论