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

Feature: Introduce show_stats argument for enhanced control over displayed statistics #46

Merged
merged 5 commits into from
Aug 9, 2024

Conversation

dnldelarosa
Copy link
Collaborator

This pull request introduces the new show_stats argument to the ggvenn function, providing users with more granular control over the statistics displayed within Venn diagrams. This addresses several open issues and offers a more versatile and intuitive approach compared to the deprecated show_percentage argument.

Users can now choose to display either the count (c), percentage (p), or both (cp) for each set in the Venn diagram. This allows for greater customization and tailoring of the output to specific needs.

Example usage:

# Show only counts
ggvenn(data, show_stats = "c")

# Show only percentages
ggvenn(data, show_stats = "p")

# Show both counts and percentages
ggvenn(data, show_stats = "cp")  # Default behavior

Related issues: #5, #26, #29, PR #45 (Addresses the scales warning - see below)

Note on scales warning:

This pull request does not directly address the scales warning mentioned in PR #45.

In summary, this pull request introduces a significant improvement to the ggvenn package by providing a more flexible and user-friendly way to control the display of statistics within Venn diagrams. It resolves existing issues, enhances clarity, and paves the way for future enhancements.

Thank you for considering this contribution!

docs: Improve documentation, deprecate `show_percentage`, and update `geom_venn`

This commit introduces several improvements to the documentation of the `ggvenn` package, deprecates the `show_percentage` argument in favor of the more versatile `show_stats` argument, and updates `geom_venn` to reflect the latest changes from @yanlinlin82.

Key changes include:

* **Added a ggvenn-package.R file:** This file provides a central location for package-level documentation. This is an automatic made for `usethis::use_lifecycle()`
* **Enabled roxygen markdown:** Markdown support has been enabled in roxygen to improve the readability and formatting of documentation.
* **Updated geom_venn.Rd:** The documentation for the `geom_venn` function has been updated to reflect the deprecation of `show_percentage`, to incorporate changes from previous commits, and to include the latest updates from @yanlinlin82.
* **Deprecated `show_percentage`:** The `show_percentage` argument has been deprecated in favor of the `show_stats` argument, which provides more flexibility in controlling the display of count and percentage information.
* **Removed commented-out code:** Commented-out code has been removed to improve code clarity and maintainability.
This commit updates the snapshot tests for the `ggvenn` package to include the deprecation warning for the `show_percentage` argument.

The `show_percentage` argument has been deprecated in favor of the more versatile `show_stats` argument. This update ensures that the snapshot tests accurately reflect the current behavior of the package, including the warning message that is displayed when using the deprecated argument.

The updated snapshots now include the following warning:

```
Warning <lifecycle_warning_deprecated>
  The `show_percentage` argument of `ggvenn()` is deprecated as of ggvenn 0.1.11.
  i Please use the `show_stats` argument instead.
```
@dnldelarosa dnldelarosa merged commit 243eca0 into yanlinlin82:master Aug 9, 2024
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.

1 participant