-
Notifications
You must be signed in to change notification settings - Fork 174
Adding confidence interval option to stat_cor #418
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
base: master
Are you sure you want to change the base?
Conversation
@kassambara are you merging or reviewing PRs? |
@gumeo Quite much of the code in 'ggpubr' has been copied from other packages, sometimes without acknowledgement, including from my own 'ggpmisc'. At the moment there are 118 open issues for 'ggpubr', and very little activity from the owner of the repo. |
@aphalo I can see that is the case. It is a shame that code is copied without acknowledgement. I think |
@gumeo The most recent commit in this repo was nine months ago, but the owner has been active in GitHub about one month ago in another repo. Lack of acknowledgement is annoying but I haven't traced the commit, so it could have been a pull request by someone else than the owner of this repo. The problem I see with the copied code in 'ggpubr' is its maintenance. At least at first sight it seems difficult to maintain and keep in sync with the original sources code copied from many different packages and written by different people. It is also a duplication of effort that I think is wasteful. It is more efficient to import from the original packages and if necessary write wrapper functions to change the user interface, rather than copying almost unchanged code and reexport it with a new name. I noticed recently this is happening with In 'ggpmisc' I have used a different approach than used for 'ggpubr': to stick to the Grammar of Graphics (to be consistent with 'ggplot2') and to avoid repackaging other extensions to 'ggplot2'. I have only copied, with acknowledgement, a few lines of code from private utility functions of 'ggplot2' and adapted some code to create new functionality. I maintain 13 R packages in CRAN, including 'ggpmisc', and it takes consistency in coding, many good test cases, and good documentation to keep the task manageable in my spare time. Of course, by now, 'ggpubr' has many reverse dependencies, so it needs to be kept alive. If a new branch is created, I think the way to go would be to try to replace as much as possible of the copied source code with imports and to get the maintainers of the imported-from packages involved when enhancements are needed. As you say, 'ggpubr' is a useful effort, but I think it is more of a collection of useful bits from other packages with some glue added than an original piece of software. Change of maintainer for CRAN packages needs to be approved by the original maintainer, unless the package has been already declared orphaned and removed from CRAN because of unresolved failures to pass checks. At the moment 'ggpubr' cleanly passes all CRAN checks in spite of all the open issues. |
@aphalo I wholeheartedly agree. R has a great packaging system, and should be used as such. I think that the interface of I just looked at the reverse deps for reference at this time: I'm not sure how many of these projects are still active, but this is further argument for the need of a tool like this. It is a long time since I last published an R package, maybe I need to get back into this. |
I would suspect quite many of them are active. 'ggpubr' is indeed very popular with nearly 200 000 downloads per month. see https://www.r-pkg.org/pkg/ggpubr It would be interesting to find out which functions are most frequently imported from 'ggpubr' by these other packages. Recent versions of 'ggplot2' define generics for |
@aphalo Is there a way to add confidence intervals like in the above example in 'ggpmisc'? |
@karl-an Not in the version of 'ggpmisc' now in CRAN, but I can add this feature to |
@karl-an I just pushed to GitHub the updated code. I also added a couple of examples to the help page of The most recent 'ggpmisc' version (under development) can be installed from GitHub using package 'remotes'. remotes::install_github("aphalo/ggpmisc") Package 'remotes' can be installed from CRAN. |
works like a charm, thanks a lot! calling it "95% CI" seems to be a little more standard, but it's already very usable in its current form. |
The numeric values are returned as conf.int.high and conf.int.low, so it is possible to assemble a different label within the |
@karl-an I made some additional progress with the implementation of CIs for correlation in 'ggpmisc'. Now CIs can also be computed by bootstrapping (using a function imported from package 'confintr'), so they are now available for all three methods: pearson, kendall and spearman. The default formatting of the labels is now according to APA and APS recomendations, which agrees with your wishes except for using square brackets. A new options lets you substitute the square brackets by any others of your choice. I pushed the last of these commits to GitHub last night. |
'ggpmisc' 0.5.0 is now in CRAN, including support for CIs. |
perfect, thanks a lot
…On Wed Aug 24, 2022, 12:39 PM GMT, Pedro Aphalo ***@***.***> wrote:
'ggpmisc' 0.5.0 is now in CRAN, including support for CIs.
—
Reply to this email directly, view it on GitHub <#418 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACQSLC4BYZAINLIL2QDCFALV2YJW3ANCNFSM47ACK76A>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
This is a small PR to add an option to visualize 95% confidence interval instead of p-value with the stat_cor geom.
Here is a minimal example:
And the resulting plot:

I think this is a useful addition to
stat_cor
. There are possibly some things that can be improved, and I have only tested this on a simple example.