-
Notifications
You must be signed in to change notification settings - Fork 130
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_percentages("col") after adorn_totals("col") does not work #525
Comments
Sorry about this. It's fixed on main branch, try installing the latest
janitor from GitHub. I am in the process of submitting to CRAN now.
Duplicate of #490. See
#490 (comment).
…On Thu, Feb 2, 2023, 4:09 AM atoikka ***@***.***> wrote:
Previously working code to get both per-column % and total % is broken,
including the example from here
https://sfirke.github.io/janitor/articles/tabyls.html
set.seed(1)raw_data <- data.frame(sex = rep(c("m", "f"), 3000),
age = round(runif(3000, 1, 102), 0))raw_data$agegroup = cut(raw_data$age, quantile(raw_data$age, c(0, 1/3, 2/3, 1)))
comparison <- raw_data %>%
tabyl(agegroup, sex, show_missing_levels = F) %>%
adorn_totals(c("row", "col")) %>%
adorn_percentages("col") %>%
adorn_pct_formatting(digits = 1)
Results in erroring out with "Error in FUN(X[[i]], ...) : only defined on
a data frame with all numeric-alike variables"
Not adding a total column before adorning percentages fixes it.
It is a call to a non-janitor function that fails, so it could plausibly
be a package issue (setdiff()?) so I can share session info if need be, but
I figured I'd let you know and see if you can reproduce it.
—
Reply to this email directly, view it on GitHub
<#525>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZYDEFUJM4EPEDCDHYDMYTWVN2TTANCNFSM6AAAAAAUOYDZZY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Great, thanks, sorry about the spam! I looked at open issues but didn't think it would be in process, looking forward to the new version! |
Whew janitor 2.2.0 is on CRAN now. Try installing it like normal and see if this resolves 😁 Thanks for reporting! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Previously working code to get both per-column % and total % is broken, including the example from here https://sfirke.github.io/janitor/articles/tabyls.html
Results in erroring out with "Error in FUN(X[[i]], ...) : only defined on a data frame with all numeric-alike variables"
Not adding a total column before adorning percentages fixes it.
It is a call to a non-janitor function that fails, so it could plausibly be a package issue (setdiff()?) so I can share session info if need be, but I figured I'd let you know and see if you can reproduce it.
The text was updated successfully, but these errors were encountered: