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.22k stars 96 forks source link

update to ggplot 2.2.0 #57

Closed MikeBadescu closed 7 years ago

MikeBadescu commented 8 years ago

ggplot2 was updated to 2.2.0 and I believe all the extensions have some trouble:

https://cran.r-project.org/web/packages/ggplot2/news.html

Unfortunately there was a major oversight in the construction of ggproto which lead to extensions capturing the super object at package build time, instead of at package run time (#1826). This problem has been fixed, but requires re-installation of all extension packages.

While removing and reinstalling ggrepel does the trick, some users might be confused. A new CRAN version should do the trick.

slowkow commented 8 years ago

Hi Mike, thank you very much for opening an issue about this. I appreciate it.

Could I ask you to help me understand what steps I should take to minimize the chance of errors for ggrepel users?

Does the problem stem from the version of ggplot2 on the CRAN servers when compiling extensions?

In other words, now that the CRAN version of ggplot2 is 2.2.0, extensions will build correctly. Previously, with ggplot2 <2.2.0 the extensions would build incorrectly. Is that true?

If I understand correctly, I should do this:

  1. Modify the DESCRIPTION file to say ggplot2 (>= 2.2.0)
  2. Upload the new source package to CRAN.

Is that right?

Thanks again!

aphalo commented 8 years ago

@slowkow I had the same doubt yesterday and asked in the r-package-devel list. Apparently we need only wait... as the binary .zips for our packages will be rebuilt in CRAN, at least for Windows. After this a binary install will solve the problems. I asked the same question about changing DESCRIPTION and Uwe Ligges, one of the CRAN admins answered:

So, my question is, as maintainer of ggpmisc and ggspectra, should I release new versions that import ggplot2 (>= 2.2.0)?

Not needed.

slowkow commented 8 years ago

Thanks for the clarification, Pedro! I will wait for now, to avoid burdening the CRAN admins with more work. If I get more reports about this issue, I'll consider uploading a new package to CRAN to speed up the resolution.

jimmyg3g commented 8 years ago

@MikeBadescu Looks like I fall into the confused users group, wish I had checked here for troubleshooting first. As I recall, my first error message after updating to ggplot 2.2.0 referred to ggproto. After stumbling upon this thread, removing ggrepel failed.

Steps to getting things working again for me:

  1. Uninstall RStudio
  2. Uninstall R
  3. Deleted files in .libPaths()
    • /Documents/R/win-library/3.3
    • /Program Files/R/R-3.3.2/libary
  4. Fresh install R, RStudio, ggplot2, ggrepel
MikeBadescu commented 8 years ago

@JimmyG3 problems removing libraries might indicate an bigger installation problem - I am glad that the clean install worked for you.

Pedro, thank you for the comment and Kamil thank you for your work.

AndrewKostandy commented 8 years ago

Hi Guys,

I did the following steps but it still doesn't work. Any suggestions?

remove.packages("ggplot2") remove.packages("ggrepel") install.packages("ggplot2") install.packages("ggrepel")

I get the below error message.

Error: GeomTextRepel was built with an incompatible version of ggproto. Please reinstall the package that provides this extension.

Everything was working fine until I got the new version of ggplot2 (version 2.2.0)

aphalo commented 8 years ago

Two wild guesses:

1) When did you use install? The binaries were updated only a couple of days ago, so mirrors may be out-of-date. Set the CRAN mirror manually to the main repo and try again. Alternatively, if you have Rtools (windows) installed force an install from sources.

2) Could you have more than one library in use?

.libPaths() will tell you the paths, then check if you have a lingering bad copy installed? Or in RStudio go through the different sections of the list of packages and make sure you uninstall all existing copies of ggrepel.

I have the following in .Rprofile, but it is overkill

if (length(.libPaths()) > 1) {
  message("Using libraries at paths:\n",
          paste("-", .libPaths(), collapse = "\n"),
          sep = "")
} else {
  message("Using library at path:\n",
          paste("-", .libPaths(), collapse = "\n"),
          sep = "")
}
AndrewKostandy commented 8 years ago

Thanks @aphalo but it still doesn't work. I tried each of the following:

install.packages("ggrepel", repos="http://cran.us.r-project.org") install.packages("ggrepel", repos = "http://cran.cnr.berkeley.edu/")

I've checked and I have only 1 library in use and one package copy installed.

My sessionInfo() is below:

R version 3.3.2 (2016-10-31) Platform: x86_64-apple-darwin13.4.0 (64-bit) Running under: macOS Sierra 10.12.1

aphalo commented 8 years ago

@AndrewKostandy Are you installing from sources? I do not think OSX binaries have been updated in CRAN. Try `install.packages("ggrepel", type = "source") if you have a suitable compiler it should work, otherwise it will give an error.

asbasu commented 8 years ago

After installing ggplot 2.2.0, I get the following error when using ggrepel::geom_label_repel()

Error: GeomLabelRepel was built with an incompatible version of ggproto. Please reinstall the package that provides this extension.

AndrewKostandy commented 8 years ago

@aphalo And now it works! Thanks a lot for your help!

@asbasu Based on @aphalo's advice I did the following steps and now I don't get this error.

remove.packages("ggrepel")

install.packages("ggrepel", type = "source")

asbasu commented 8 years ago

@aphalo I get a compiler permission error: Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.

Is there a way to do this without running as root?

aphalo commented 8 years ago

I am not really familiar with Mac but I think you need admin privileges only once, when you use Xcode for the first time. Can you get anybody with admin rights to 'sudo' and accept the licence (it is free anyway).

asbasu commented 8 years ago

@aphalo Thanks that worked!

rdiaz02 commented 8 years ago

This has shown up in several BioConductor packages. The problem (identified by Hervé Pages, and explained in detail here https://stat.ethz.ch/pipermail/bioc-devel/2016-November/010151.html) seems to be that the binary Mac version of ggrepel 0.6.3 was built before the changes in ggplot2.

The simplest solution would probably be to bump the ggrepel version to, say, 0.6.4, so that for al operating systems there is a new version in CRAN built after the changes in ggplot2 and so that update.packages() will fix the issue.

P.S. I am posting here so that Mac OS X users have as reference the BioC thread. I just emailed @slowkow about this issue as I had not looked here since this is not really a bug of ggrepel. Apologies to Kamil for the double report.

slowkow commented 8 years ago

I uploaded 0.6.5 to CRAN right now. I hope the new package is approved and made available soon.

After it is uploaded, my understanding is that the binary ggrepel package will automatically be built with the newest version of ggplot2 available on CRAN. This should resolve the ggproto error.

slowkow commented 7 years ago

It seems that the 0.6.5 binary packages are on CRAN.

Please re-open this issue if you run into any more errors.