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

Error when using xray::distributions() with only categorical variables #8

Closed
bgrich opened this issue Dec 15, 2017 · 2 comments
Closed

Comments

@bgrich
Copy link

bgrich commented Dec 15, 2017

When using xray::distributions() with only categorical variables, I received the error:

Error in names(object) <- nm : attempt to set an attribute on NULL

This appeared with both strings and factors.

df_1 <- data.frame(string_dat = c("a", "b", "b"))
xray::distributions(df_1)
df_2 <- data.frame(fact_dat = factor(c("a", "b", "b"), levels = c("a", "b")))
xray::distributions(df_2)

The inclusion of at least one numerical variable appears to fix this problem.

df_3 <- data.frame(numerical_dat = c(1, 2, 2), string_dat = c("a", "b", "b"))
xray::distributions(df_3)

Fortunately, this error doesn't appear to cause any problems with the output from the function.

@sicarul
Copy link
Owner

sicarul commented Dec 23, 2017

Thanks for reporting it, it was a silly mistake

@sicarul
Copy link
Owner

sicarul commented Dec 23, 2017

Fixed in 945e9c6 - Thanks for reporting with reproducible examples!

@sicarul sicarul closed this as completed Dec 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants