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

Compare_levels with unevaluated expressions cannot parse "." #174

Closed
annlaurin opened this issue Jun 11, 2019 · 2 comments
Closed

Compare_levels with unevaluated expressions cannot parse "." #174

annlaurin opened this issue Jun 11, 2019 · 2 comments

Comments

@annlaurin
Copy link

Hi,

I've run into a problem with compare_levels(). I want to make a custom comparison and use unevaluated expressions, but even with your demo data set this does not work:

fit %>% spread_draws(condition_mean[condition]) %>% compare_levels(condition_mean, by = condition, comparison = .(A-B))
I get the following error message:

Error in .(A - B) : could not find function "."

I've just updated R to version 3.6 and tidybayes to version 1.1.0, but the problem persists.

@mjskay
Copy link
Owner

mjskay commented Jun 13, 2019

Thanks for raising this issue! I need to update the comparison argument to use a modern modern / tidyverse approach to unevaluated expressions. In the mean time, the . function referred to in the documentation is plyr::., so something like this should work:

fit %>% 
  spread_draws(condition_mean[condition]) %>% 
  compare_levels(condition_mean, by = condition, comparison = plyr::.(A-B))

Let me know if that works. I'll clarify this in the documentation and update the comparison code to be compatible with newer ways of doing this in rlang.

@annlaurin
Copy link
Author

Thanks a lot, that works!

@mjskay mjskay closed this as completed Jun 14, 2019
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