dplyr-获取行最大值与行最大值对应的索引列

2023-01-10  本文已影响0人  倪桦

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(.)])
上一篇下一篇

猜你喜欢

热点阅读