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

GG_denhist and SMD_matrix, error/bad output with groups without data #35

Closed
Deleetdk opened this issue Jan 28, 2017 · 1 comment
Closed
Assignees
Labels

Comments

@Deleetdk
Copy link
Owner

Error occurs when some groups have no data, and the coloring thus cannot be applied. These cause NAs in the central_tendency vector. This gets passed on to:

g = g + geom_vline(xintercept = central_tendency, linetype = "dashed", 
  size = 1, color = colors)

Which causes the error:

Error: Aesthetics must be either length 1 or the same as the data (6): colour, size, linetype

Solution is to exclude such groups before trying to plot.

This problem also occurs with SMD_matrix. It does not error, but gives bad output:

> SMD_matrix(d$g_noage, group = d$sex)
             missing inapplicable refused don't know male female
missing           NA          NaN     NaN        NaN  NaN    NaN
inapplicable     NaN           NA     NaN        NaN  NaN    NaN
refused          NaN          NaN      NA        NaN  NaN    NaN
don't know       NaN          NaN     NaN         NA  NaN    NaN
male             NaN          NaN     NaN        NaN   NA   0.22
female           NaN          NaN     NaN        NaN 0.22     NA
@Deleetdk Deleetdk added the bug label Jan 28, 2017
@Deleetdk Deleetdk self-assigned this Jan 28, 2017
@Deleetdk
Copy link
Owner Author

Deleetdk commented Jan 28, 2017

On second thought. SMD_matrix should return NaN output. It's possible that there are holes in group comparisons in complex ways and we want it to work in that case too.

Deleetdk added a commit that referenced this issue Jan 28, 2017
Deleetdk added a commit that referenced this issue Jan 28, 2017
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