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

Implemented sorting in all functions except for two-way tables. #29

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

theshiniss
Copy link

@theshiniss theshiniss commented May 25, 2024

Implemented sorting in all functions except for two-way tables, where a warning is printed if sort = TRUE. Updated the help documentation accordingly.

@theshiniss theshiniss changed the title Implemented sorting in all functions except for tab2. Implemented sorting in all functions except for two-way tables. May 25, 2024
Copy link
Owner

@gvelasq gvelasq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this pull request. Could you please update NEWS.md and add a test?

R/tab.R Outdated
#'
#' tab2(x, ..., m = TRUE)
#'
#' @param x A vector, data.frame, or tibble.
#' @param ... A comma separated list of unquoted variable names or positions. Select helpers from [dplyr](https://dplyr.tidyverse.org/reference/select.html) and [tidyselect](https://rdrr.io/cran/tidyselect/man/select_helpers.html) are supported.
#' @param m If `TRUE` (the default), missing values are reported.
#' @param sort If `TRUE` (default is `FALSE`), will show the largest groups at the top. Sorting is not implemented for two-way tables.
Copy link
Owner

@gvelasq gvelasq May 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth mentioning here that the default behavior is to sort (ascending) by value and that sort = TRUE changes this behavior to sort (descending) by frequency.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

theshiniss and others added 2 commits May 27, 2024 17:44
I introduced a typo ('# missing) on line 25
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

Successfully merging this pull request may close these issues.

2 participants