You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
descr does not calculate statistics (e.g. min, max) correctly if the column names contain exactly the same postfixes as the statistics function string (e.g. "column_min" or "column_max")
#152
Open
yenchiayi opened this issue
Nov 4, 2021
· 0 comments
However, if I set column names as c("x", "x_min", "x_max"), then descr does not calculate minimum and maximum (as well as other statistics like "n.valid", "skewness", and "kurtosis" ) correctly.
As seen in below output, the Min of column 2 (x_max) is even larger than its Max. Other statistics like N.Valid, "Skewness", and "Kurtosis" are also wrong for the column "x_max" and "x_min".
x
x_max
x_min
Min
1.00
21
1
Max
2.00
2
1
N.Valid
2.00
1
1
Skewness
0.00
NA
NA
Kurtosis
-2.75
NA
NA
My preliminary guess is that the the program may fail to distinguish the column name postfix (e.g. x_min) and the function name (e.g. min). I found that this issue arises around line 367-373 In descr.R. You may check this and see what happens.
Thanks!
The text was updated successfully, but these errors were encountered:
I have a small data.frame with dimension = (2, 3) as follows:
The descr function calculates everything correctly if I set column names as c("x", "x_1", "x_2"):
However, if I set column names as c("x", "x_min", "x_max"), then descr does not calculate minimum and maximum (as well as other statistics like "n.valid", "skewness", and "kurtosis" ) correctly.
As seen in below output, the Min of column 2 (x_max) is even larger than its Max. Other statistics like N.Valid, "Skewness", and "Kurtosis" are also wrong for the column "x_max" and "x_min".
My preliminary guess is that the the program may fail to distinguish the column name postfix (e.g. x_min) and the function name (e.g. min). I found that this issue arises around line 367-373 In descr.R. You may check this and see what happens.
Thanks!
The text was updated successfully, but these errors were encountered: