Leaflet not installing

I am trying to install leaflet but it is not installing. I have a windows operating system and the error code is below.

WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

Installing package into ‘C:/Users/Michael/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
Warning in install.packages :
dependency ‘raster’ is not available

There is a binary version available but the source version is
binary source needs_compilation
leaflet 2.0.2 2.0.3 FALSE

installing the source package ‘leaflet’

trying URL 'https://cran.rstudio.com/src/contrib/leaflet_2.0.3.tar.gz'
Content type 'application/x-gzip' length 2039454 bytes (1.9 MB)
downloaded 1.9 MB

ERROR: dependency 'raster' is not available for package 'leaflet'

  • removing 'C:/Users/Michael/Documents/R/win-library/3.4/leaflet'
    Warning in install.packages :
    running command '"C:/PROGRA~1/R/R-34~1.2/bin/x64/R" CMD INSTALL -l "C:\Users\Michael\Documents\R\win-library\3.4" C:\Users\Public\Documents\Wondershare\CreatorTemp\RtmpasHzjz/downloaded_packages/leaflet_2.0.3.tar.gz' had status 1
    Warning in install.packages :
    installation of package ‘leaflet’ had non-zero exit status

The downloaded source packages are in

Your R version is too old, the raster package (which is a dependency for leaflet) requires R >= 3.5 Try updating R, the latest version is 4.0.3

1 Like

This topic was automatically closed 7 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.