billdenney/pknca

Error: object ‘palette.colors’ is not exported by 'namespace:grDevices'

jflyingeagle opened this issue · 6 comments

Whether using a terminal or RStudio, I get the error below.
I'm using Linux kernel 5.4.0.
R version is 3.6.3 (2020-02-29)
Rstudio version is 2023.06.1 build 524
Any suggestions? I can't figure out if this is an issue with the PKNCA package, R, or something else.

install.packages("PKNCA")
==================================================
downloaded 1013 KB

  • installing source package ‘PKNCA’ ...
    ** package ‘PKNCA’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    Error: object ‘palette.colors’ is not exported by 'namespace:grDevices'
    Execution halted
    ERROR: lazy loading failed for package ‘PKNCA’
    Warning in install.packages :
    installation of package ‘PKNCA’ had non-zero exit status

This does not occur on my system, and I don't think that PKNCA uses that function directly. My guess is that upgrading R will fix it. (R version 3.6.3 is 3 years old.)

Thanks for your help. It looks like the sources list may be pointing to an old or the wrong repository, so I'll try to fix that or just compile it. That should fix it.

The grDevices package is built into R, so I don't know if something other than updating R will fix it.

The pallette.colors() function is not called directly by PKNCA, so maybe installing the package without the vignettes may work (I don't know a way to do that).

After updating the repository sources, I successfully installed R 4.3.1. Adding PKNCA returned no errors. I will give it a go.
Thanks again!

I'm glad that it worked!

For future support, I believe that you're referring to the debian/ubuntu apt repository, and you had to change so that you're installing the current version of R.

Yes, that's correct.
First, I removed the currently installed r-base.
I'm using Mint 20.3, so I checked which ubuntu release:
$ cat /etc/upstream-release/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu Focal Fossa"

Then verified that the repository in additional-repositories.list is correct, according to the install instructions (https://ftp.osuosl.org/pub/cran/):
deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/

Then the usual apt update, checking that the R version is current with apt show r-base, and apt upgrade and/or install, as necessary.

Hope this helps if it's ever needed in the future.