You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have made a function that is able to draw a ggplot2 plot using ggrepel::geom_label_repel() for the labels.
I have the same warning printed multiple time (ggrepel: 15 unlabeled data points (too many overlaps). Consider increasing max.overlaps with 15 being just an example, the number can vary following the use).
For some reason, even after having these warnings displayed right after the use of the function, if I just continue with other manual commands, the warnings are printed again randomly, which is very strange.
When I check baseenv()$last.warning the warnings are still here indeed. But that doesn't explain why the warnings are printed randomly.
Minimal code example
I don't really have a "minimal" example to provide. But instead I would say any kind of plot you produce that could raise the warnings cited above when using ggrepel::geom_label_repel.
The function creates the plot following these steps, and everything works great on the output plot:
Currently, I fix this issue using the following command, after executing my function when this specific warning is raised (printed once or multiple times) : assign("last.warning", NULL, envir = baseenv())
This stops the warnings from being printed randomly.
Version information
Here is the output from sessionInfo() in my R session (be aware that some of the packages loaded are mine and are not all publicly available):
Summary
I have made a function that is able to draw a ggplot2 plot using ggrepel::geom_label_repel() for the labels.
I have the same warning printed multiple time (
ggrepel: 15 unlabeled data points (too many overlaps). Consider increasing max.overlaps
with 15 being just an example, the number can vary following the use).For some reason, even after having these warnings displayed right after the use of the function, if I just continue with other manual commands, the warnings are printed again randomly, which is very strange.
When I check
baseenv()$last.warning
the warnings are still here indeed. But that doesn't explain why the warnings are printed randomly.Minimal code example
I don't really have a "minimal" example to provide. But instead I would say any kind of plot you produce that could raise the warnings cited above when using ggrepel::geom_label_repel.
The function creates the plot following these steps, and everything works great on the output plot:
Suggestions
Currently, I fix this issue using the following command, after executing my function when this specific warning is raised (printed once or multiple times) :
assign("last.warning", NULL, envir = baseenv())
This stops the warnings from being printed randomly.
Version information
Here is the output from
sessionInfo()
in my R session (be aware that some of the packages loaded are mine and are not all publicly available):The text was updated successfully, but these errors were encountered: