说我有一个数据框:
DF <- data.frame(V1=c(2,8,1),V2=c(7,3,5),V3=c(9,6,4))
>DF
V1 V2 V3
1 2 7 9
2 8 3 6
3 1 5 4
我知道您可以使用以下命令返回单个列的最高值的rowname:
which.max(DF[,1])
但是可以使用哪个匹配返回每列中最高值的rowname,而无需为数据框中的每个列手动输入which.max?
提前致谢。
答案 0 :(得分:3)
使用循环
function post(){
var options = {
hostname: 'something.google.com',
port: 443,
path: '/',
method: 'post'
};
var data = {.....}
var req = https.request(options,(res)=>{
....
...
});
req.write(JSON.stringify(data));
req.on('error',(e)=>{
setTimeout(()=> {
post();
}, 50000);
})
req.end();
}