Skip to content

[FEAT] Exact reporting of missing values #880

Description

@634523

What aspect of the package is your request related to?

Reporting of missing values.

Describe the solution you'd like

Echoing #624 and @kylebutts in #624 I would also prefer if qsu() and descr() would show the exact number of NAs.

First, this would be consistent with base R summary(). Furthermore, it would avoid misleading cases like the example below:

library(collapse)

df <- data.frame(x = rnorm(1000000))
na_position <- sample(1:1000000, 1)
df$x[na_position] <- NA

descr(df)
qsu(df)
> descr(df)
Dataset: df, 1 Variables, N = 1000000
-----------------------------------------------------------------------------------------
x (numeric): 
Statistics (0% NAs)
       N   Ndist  Mean  SD    Min   Max  Skew  Kurt
  999999  999999    -0   1  -4.68  4.89    -0     3
Quantiles
     1%     5%    10%    25%  50%   75%   90%   95%   99%
  -2.33  -1.65  -1.28  -0.68   -0  0.67  1.28  1.64  2.32
-----------------------------------------------------------------------------------------
> qsu(df)
        N     Mean      SD      Min     Max
x  999999  -0.0024  0.9994  -4.6793  4.8876

Even though we have a missing value in the data.frame 0% NAs are reported.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions