我见过this,但我想知道为什么它不适合我的情况
我有这个载体:
function rechnung()
{
var x = document.getElementById("range3").innerHTML;
alert(x);
}
然后我试图找到大于0的最小值num<-c(0.000000, 4.220190, 1.421267, 1.004988, 5.060632, 1.100000, 3.744329, 5.728001, 4.707441, 4.100000, 5.200961, 5.060632, 2.282542
,1.676305, 0.509902, 0.781025, 2.968164, 5.916925, 5.235456, 5.371220)
所以我有
0.509902
但它给了我
which.min(num > 0)
索引1
答案 0 :(得分:1)
我们可以使用select BillNumber, BillDate,
(select CustomerName from tblCustomer
where tblCustomer.CustomerId = tblBillHeader.CustomerId) as CustomerName,
(Select ProductId from tblBillDetail
where tblBillHeader.BillNumber = tblBillDetail.BillNumber) as ProductId
from tblBillHeader;
替换小于或等于0的值,并使用NA
which.min
或稍微紧凑的方式
i1 <- which.min(replace(num, num<=0, NA))
i1
#[1] 15