slowkow / ggrepel

:round_pushpin: Repel overlapping text labels away from each other in your ggplot2 figures.
https://ggrepel.slowkow.com
GNU General Public License v3.0
1.21k stars 95 forks source link

Error in geoms: could not find function "replace_null" #259

Closed SaileeSakhalkar closed 6 months ago

SaileeSakhalkar commented 6 months ago

Hi, I ran into an error today that won't let me use either of the geoms. Even upon running the examples, the console returns

Error in replace_null(unclass(data), label = "a", angle = 0) : 
  could not find function "replace_null"

Here's the code I ran from the examples:

p <- ggplot(mtcars,
  aes(wt, mpg, label = rownames(mtcars), colour = factor(cyl))) +
  geom_point()

# Avoid overlaps by repelling text labels
p + geom_text_repel()

This worked as of last week, but doesn't anymore. I tried to run the examples in a fresh R session and have the same problem. Is there maybe a dependency that has been updated?

Thanks!

slowkow commented 6 months ago

This looks like the same issue as #258 where the person who reported the issue said:

Upgrading ggplot to 3.5.0 looks to have solved the problem.

So, please consider running:

install.packages("ggplot2")

to update ggplot2 to the latest version.

If you still see issues, then please make sure to share your session information from sessionInfo() with all versions of all packages along with your reproducible code example.

SaileeSakhalkar commented 6 months ago

Thanks for replying so quickly! I updated ggplot to the latest version, and it worked perfectly fine :)