teunbrand / ggh4x

ggplot extension: options for tailored facets, multiple colourscales and miscellaneous
https://teunbrand.github.io/ggh4x/
Other
534 stars 32 forks source link

Install issues with `ggplot2` 3.4.2 #103

Closed MetzgerSK closed 1 year ago

MetzgerSK commented 1 year ago

R: 4.2.3 64 bit, ggh4x 0.2.3, Ubuntu 18.04 LTS

Problem

install.packages("ggh4x") will currently install ggplot2 3.4.2 when it installs all of ggh4x's defined dependencies. However, the final step—actually installing ggh4x—will throw an error:

* installing *source* package 'ggh4x' ...
** package 'ggh4x' successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in get(x, envir = ns, inherits = FALSE) :
  object 'continuous_range' not found
Error: unable to load R code in package 'ggh4x'
Execution halted
ERROR: lazy loading failed for package 'ggh4x'
* removing '/usr/local/lib/R/site-library/ggh4x'

The downloaded source packages are in
        '/tmp/Rtmp9RepEe/downloaded_packages'
Warning message:
In install.packages("ggh4x") :
  installation of package 'ggh4x' had non-zero exit status

However, the same problem doesn't occur if I install all of ggh4x's dependencies, force-install ggplot 3.4.0 after that, then install ggh4x again without updating its dependencies:

# (Continued in same R session w/failed install attempt from previous output excerpt)

> remotes::install_version("ggplot2", "3.4.0")
Downloading package from url: https://cloud.r-project.org/src/contrib/Archive/ggplot2/ggplot2_3.4.0.tar.gz
#### [LOTS OMITTED FOR BREVITY] ####
* DONE (ggplot2)

> install.packages("ggh4x", dependencies=FALSE)
Installing package into '/usr/local/lib/R/site-library'
(as 'lib' is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/ggh4x_0.2.3.tar.gz'
Content type 'application/x-gzip' length 1294558 bytes (1.2 MB)
==================================================
downloaded 1.2 MB

* installing *source* package 'ggh4x' ...
** package 'ggh4x' successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (ggh4x)

The downloaded source packages are in
        '/tmp/RtmpQlBIQU/downloaded_packages'

MWE

In the terminal, on a system where Docker's installed:

# Pull fresh Ubuntu 18.04 image
docker pull ubuntu:18.04

# Launch temp container from image
docker run -ti --rm ubuntu:18.04

# ----- << container now active >> -----

# Install R
## Add to source list
echo "deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/" >> /etc/apt/sources.list
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
apt-get update

## Install
apt-get install r-base-dev

# Launch R
R

And then, within R:

# Will get angry and throw error
install.packages("ggh4x")       # (will also install all the other dependencies ggh4x needs)

# But, install a lower-ggplot2 version first, and it's smooth sailing.
install.packages("remotes")
remotes::install_version("ggplot2", "3.4.0")
install.packages("ggh4x", dependencies=FALSE)
teunbrand commented 1 year ago

Hi there, thanks for the report. I'm aware ggh4x is currently incompatible with the latest ggplot2. I've started preparing a new release, which progress you can track over at #96, to catch up with the latest changes. However, I can't yet predict when it will be on CRAN, but my hope is soon.

MetzgerSK commented 1 year ago

Great, thanks for the explanation (and so quickly). I saw #96, but hadn't put two and two together, so to speak. I'll keep an eye out for the CRAN update and force-install ggplot2 < 3.4.2 in the interim.

teunbrand commented 1 year ago

For the interim, you should be able to use devtools::install_github('teunbrand/ggh4x@0.2.4rc') to install the new version from GitHub. I'm gonna re-open this issue and close it when ggh4x lands on CRAN, so that people who experienced the same thing can see it.