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

dfSummary fails when a whole factor column is NA #9

Closed
labrax opened this issue Jan 10, 2018 · 4 comments
Closed

dfSummary fails when a whole factor column is NA #9

labrax opened this issue Jan 10, 2018 · 4 comments
Labels

Comments

@labrax
Copy link

labrax commented Jan 10, 2018

Hi,

When I was trying to generate a dfSummary of a new dataset I could not due to an error. I could replicate the bug when running this functions on the iris dataset. This error occurs when I have a whole factor column with NAs.

This works:

data(iris)
dfSummary(iris)

Now, when I set a factor column to NA it doesn't.

iris$Species <- as.factor(rep(NA, nrow(iris)))
dfSummary(iris)

This is the error, identical to my dataset.
Error in png(img_png <- tempfile(fileext = ".png"), width = 150, height = 26 * :
invalid 'height' argument
In addition: Warning messages:
1: In max(counts) : no non-missing arguments to max; returning -Inf
2: In max(props * 100) : no non-missing arguments to max; returning -Inf

Regards,
Victor

@dcomtois
Copy link
Owner

Thanks for pointing this out, will check it out over the next few days.

@dcomtois
Copy link
Owner

Can you pls test again after installing dev-current?

devtools::install_github('dcomtois/summarytools', ref='dev-current')

Thanks Victor!

@labrax
Copy link
Author

labrax commented Jan 12, 2018

It is working. Thank you.

@labrax labrax closed this as completed Jan 12, 2018
@dcomtois
Copy link
Owner

Fix was merged into master branch. Thanks!

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

2 participants