大于在

时间:2016-05-12 13:54:39

标签: r data.table

我观察到以下情况正在发生在我的临时状态。 data.table:

> temp[ Quant==0.95, table(Quant>0.95) ]

TRUE 
270 

我期待输出为FALSE 270.

有任何帮助吗?谁知道为什么会这样?

> str(temp)
Classes ‘data.table’ and 'data.frame':  27270 obs. of  6 variables:
 $ variable: Factor w/ 270 levels "ABC",..: 1 1 1 1 1 1 1 1 1 1 ...
 $ valor   : num  14.2 113.5 115.8 119.4 126 ...
 $ Quant   : num  0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 ...
 $ diff    : num  NA 99.33 2.27 3.65 6.56 ...
 $ diffrel : num  NA 701.32 2 3.15 5.5 ...
 $ OUT     : logi  NA TRUE FALSE FALSE FALSE FALSE ...
 - attr(*, "sorted")= chr "variable"
 - attr(*, ".internal.selfref")=<externalptr> 


> dput(temp[Quant==0.95][1:10])
list(structure(variable = structure(1:10, .Label = c("ABC1", 
"ABC2", ...), class = "factor"), valor = c(252.646587028526, 
97.5068274054612, 254.414595678155, 247.409223101158, 445.752643124162, 
90.7517305346826, 503.46065187912, 492.167958424324, 470.266144426119, 
98.6691455960533), Quant = c(0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 
0.95, 0.95, 0.95, 0.95), diff = c(0.911415364775934, 1.34678329468818, 
1.36079710720148, 0.713478575642938, 0.427664916600406, 0.197920933441281, 
0.0294742181829406, 0.548231698168934, 3.18522829657502, 0.243689644761076
), diffrel = c(0.36205324776521, 1.40056434784569, 0.537750120680336, 
0.289213977734077, 0.0960343429020674, 0.218567208064285, 0.00585466683249237, 
0.111515398663877, 0.681943574781292, 0.247588027310405), OUT = c(FALSE, 
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE
)), .Names = c("variable", "valor", "Quant", "diff", "diffrel", 
"OUT"), sorted = "variable", class = c("data.table", "data.frame"
), row.names = c(NA, -10L), .internal.selfref = <pointer: 0x230a978>)

非常感谢任何帮助和/或指针!

NOELIA

0 个答案:

没有答案