Skip to content

tidy_emmeans handles contrasts when column names have dashes #351

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

Merged
merged 5 commits into from
Jun 12, 2018

Conversation

bmannakee
Copy link
Contributor

  • changed sep="-" to sep=" - " in separate_ call in tidy_emmeans
  • return a tibble from tidy_emmeans
  • add test data and test to test_lsmeans.R

Output looks like

suppressMessages(library(tidyverse))
suppressMessages(library(broom))
suppressMessages(library(lsmeans))
data_frame(y = rnorm(100), x = rep(c("Single", "Double-Barrelled"), 50)) %>% 
  lm(y ~ x, data = .) %>% lsmeans::lsmeans(., ~x) %>% lsmeans::contrast(., 
  "pairwise") %>% tidy %>% print()
#> # A tibble: 1 x 7
#>   level1           level2 estimate std.error    df statistic p.value
#> * <chr>            <chr>     <dbl>     <dbl> <dbl>     <dbl>   <dbl>
#> 1 Double-Barrelled Single   0.0617     0.187    98     0.329   0.743

@alexpghayes alexpghayes merged commit ad158e4 into tidymodels:master Jun 12, 2018
@alexpghayes
Copy link
Collaborator

Spectacular! Thank you!

@github-actions
Copy link

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants