Make scatterplot public - #286
Merged
Merged
Conversation
…s against continuous covariates. Enhance documentation and examples for new function, and update introduction vignette to reference sccomp_scatterplot. Adjust plot.sccomp_tbl to utilize the new scatterplot function for continuous factors.
…visualizing cell-group proportions against continuous covariates. Documented the function in the introduction vignette, enhancing user guidance for its application.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes the continuous-covariate scatterplot functionality publicly available as sccomp_scatterplot(), updates the default plot() method to use it for numeric covariates, and documents/tests the new public API.
Changes:
- Exported and documented
sccomp_scatterplot()for visualising proportions vs continuous covariates. - Updated
plot.sccomp_tbl()to route numeric covariates tosccomp_scatterplot()and discrete covariates tosccomp_boxplot(). - Added vignette section and test coverage for the new scatterplot.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| vignettes/introduction.Rmd | Documents use of sccomp_scatterplot() for continuous covariates and ensures sccomp_test() is run before plotting. |
| tests/testthat/test-plot.R | Adds tests asserting sccomp_scatterplot() returns a ggplot object (with and without unwanted-effect removal). |
| R/plot.R | Updates plot.sccomp_tbl() to delegate to sccomp_scatterplot() for numeric covariates and sccomp_boxplot() for discrete ones. |
| R/plot_scatterplot.R | Introduces exported sccomp_scatterplot() wrapper around the existing internal scatterplot implementation. |
| NAMESPACE | Exports sccomp_scatterplot. |
| man/sccomp_scatterplot.Rd | Adds generated Rd documentation for sccomp_scatterplot(). |
| inst/NEWS.rd | Announces the new exported scatterplot function and vignette update. |
| DESCRIPTION | Bumps package version to 2.1.34. |
Files not reviewed (1)
- man/sccomp_scatterplot.Rd: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if(attr(x, "count_data") |> select(all_of(.x)) |> pull(1) |> is("numeric")) | ||
| my_plot = | ||
| plot_scatterplot( | ||
| sccomp_scatterplot( |
| @@ -135,8 +104,7 @@ plot.sccomp_tbl <- function( | |||
| ) | |||
Comment on lines
+117
to
+118
| ) + | ||
| ggtitle(sprintf("Grouped by %s (for multi-factor models, associations could be hardly observable with unidimensional data stratification)", factor)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.