Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

miss_analyze: error with mixed data #48

Closed
Deleetdk opened this issue Jan 30, 2017 · 1 comment
Closed

miss_analyze: error with mixed data #48

Deleetdk opened this issue Jan 30, 2017 · 1 comment
Labels

Comments

@Deleetdk
Copy link
Owner

> test_data %>% miss_analyze()
Error in pool_sd(d_x$x, d_x$group) : x must be a vector!
> test_data %>% str
'data.frame':	150 obs. of  6 variables:
 $ Sepal.Length: num  5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ...
 $ Sepal.Width : num  3.5 3 3.2 NA 3.6 3.9 3.4 3.4 2.9 NA ...
 $ Petal.Length: num  1.4 1.4 1.3 1.5 1.4 1.7 1.4 1.5 1.4 1.5 ...
 $ Petal.Width : num  0.2 0.2 0.2 0.2 0.2 0.4 0.3 0.2 0.2 0.1 ...
 $ Species     : Factor w/ 3 levels "setosa","versicolor",..: 1 1 1 1 1 1 1 1 1 1 ...
 $ type        : chr  "C" NA "A" "C" ...
@Deleetdk Deleetdk added the bug label Jan 30, 2017
@Deleetdk
Copy link
Owner Author

Could not reproduce with iris.

> iris %>% miss_add_random() %>% miss_analyze()
             Sepal.Length Sepal.Width Petal.Length Petal.Width Species
Sepal.Length           NA       0.023        -0.46       -0.41    0.31
Sepal.Width         0.050          NA         0.28        0.21    0.14
Petal.Length       -0.193       0.116           NA       -0.17    0.23
Petal.Width         0.037       0.789        -0.11          NA    0.19
Species            -0.247      -0.026        -0.25       -0.13      NA

Perhaps due to chr col?

> iris %>% miss_add_random() %>% cbind(chr = sample(c("A", "B", "C", NA), 150, T)) %>% miss_analyze()
             Sepal.Length Sepal.Width Petal.Length Petal.Width Species  chr
Sepal.Length           NA       -0.16        0.558       0.580    0.32 0.24
Sepal.Width        -0.245          NA       -0.374      -0.272    0.39 0.46
Petal.Length       -0.016        0.30           NA      -0.276    0.19 0.20
Petal.Width        -0.050       -0.43       -0.100          NA    0.07 0.27
Species             0.080       -0.10       -0.023      -0.066      NA 0.19
chr                -0.208        0.11       -0.065       0.040    0.10   NA
> iris %>% miss_add_random() %>% cbind(chr = sample(c("A", "B", "C", NA), 150, T)) %>% miss_amount()
cases with missing data  vars with missing data cells with missing data 
                   0.52                    1.00                    0.12 

Does not seem there is any error. Perhaps was fixed and I forgot to update issue. Closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant