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

adorn_totals fails after non-piped tabyl() call on a vector #118

Closed
sfirke opened this issue May 13, 2017 · 2 comments
Closed

adorn_totals fails after non-piped tabyl() call on a vector #118

sfirke opened this issue May 13, 2017 · 2 comments
Labels

Comments

@sfirke
Copy link
Owner

sfirke commented May 13, 2017

Good:

mtcars %>% tabyl(cyl) %>% adorn_totals("row")
    cyl  n percent
1     4 11 0.34375
2     6  7 0.21875
3     8 14 0.43750
4 Total 32 1.00000

Very bad:

> tabyl(mtcars$cyl) %>% adorn_totals("row")
Error in eval(x$expr, data, x$env) : object 'mtcars' not found

Look at whether the dollar sign in the name of column 1 is the problem?

@sfirke sfirke added the bug label May 13, 2017
@sfirke
Copy link
Owner Author

sfirke commented May 13, 2017

This fails too: crosstab(mtcars$cyl, mtcars$carb) %>% adorn_totals()

@sfirke sfirke closed this as completed in bacdf88 May 22, 2017
@sfirke
Copy link
Owner Author

sfirke commented May 22, 2017

removed an entirely redundant line of code 🤔 (looks like this problem is fixed under dplyr 0.6.0, so users of janitor 0.3.0 on CRAN can fix by upgrading their dplyr if they don't want the latest janitor from GitHub)

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