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

ggally_cor errors out if number of samples is less than 3 rather than returning NA #480

Open
janlimbeck opened this issue Dec 18, 2023 · 0 comments

Comments

@janlimbeck
Copy link

When calling ggally_cor on data sets with less than 3 samples the function errors out due cor.test.default requiring more than 2 samples. It would be better if the function would not fail hard but return NA instead since ggally_cor is also used within ggpairs which would then also fail if used in conjunction with a mapping that leads to combinations with less than 3 samples.

library(GGally)
data(tips, package = "reshape")
ggally_cor(tips[1:2, ], mapping = ggplot2::aes_string(x = "total_bill", y = "tip"))
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

No branches or pull requests

1 participant