Closed SixiangHu closed 6 years ago
test = data.frame(a = c(1,NA),b = c(1,1)) DataSummary(test)
VarName VarType Unique Missing Missing_pct Mean Min Max Entropy 1: a numeric 2 1 0.5 0.5 1 1 0 2: b numeric 1 0 0.0 1 1 1 0
It is related to: https://github.com/SixiangHu/DataMan/blob/master/R/DataSummary.R#L75
That when x include NAs, the sum of weighted is less than sum(weight,na.rm=TRUE) because there is no NA in weight.
x
NA
sum(weight,na.rm=TRUE)
weight
VarName VarType Unique Missing Missing_pct Mean Min Max Entropy 1: a numeric 2 1 0.5 0.5 1 1 0 2: b numeric 1 0 0.0 1 1 1 0
It is related to: https://github.com/SixiangHu/DataMan/blob/master/R/DataSummary.R#L75
That when
x
includeNA
s, the sum of weighted is less thansum(weight,na.rm=TRUE)
because there is noNA
inweight
.