Cannot install scales

Hi All,

I am new to R and tried to install ggplot2, but got notified that I should install scales first. Upon trying to install scale, I got the following error:

also installing the dependency ‘rlang’

There are binary versions available but the source versions are later:
binary source needs_compilation
rlang 0.4.11 1.0.2 TRUE
scales 1.1.1 1.2.0 FALSE

Binaries will be installed
trying URL ''
Content type 'application/zip' length 1224139 bytes (1.2 MB)
downloaded 1.2 MB

package ‘rlang’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
installing the source package ‘scales’

trying URL ''
Content type 'application/x-gzip' length 270188 bytes (263 KB)
downloaded 263 KB

  • installing source package 'scales' ...
    ** package 'scales' successfully unpacked and MD5 sums checked
    ** using staged installation
    ** R
    ** byte-compile and prepare package for lazy loading
    Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
    namespace 'rlang' 0.4.11 is being loaded, but >= 1.0.0 is required
    Calls: ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace
    Execution halted
    ERROR: lazy loading failed for package 'scales'
  • removing 'C:/Users/dell/anaconda3/envs/rstudio/lib/R/library/scales'
    Warning in install.packages :
    installation of package ‘scales’ had non-zero exit status

The downloaded source packages are in

Please help.


Hi Yogee,

The problem is that it's trying to install a newer version of scales that requires a newer version of rlang that isn't available. I notice that it appears you're using R 3.6, which is getting quite old. The easiest option would be to upgrade to a newer version of R (4.2.1 is the current version), then everything should install fine.

If you really need to use R 3.6, install the compatible binary version of the scales package with:

install.packages("scales", type="binary")

and that should work for you


This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.