rnaturalearth icon indicating copy to clipboard operation
rnaturalearth copied to clipboard

Error installing rnaturalearthhires

Open aneal01 opened this issue 2 years ago • 2 comments

Hi, I'm having trouble installing rnaturalearthhires. Any help that could be provided would be much appreciated.

Reproducible example is below.

library(rnaturalearth)

world <- ne_countries(scale = "large", returnclass = "sf") The rnaturalearthhires package needs to be installed. Install the rnaturalearthhires package?

1: Yes 2: No

Selection: 1 Installing the rnaturalearthhires package. Error in value[3L] : Failed to install the rnaturalearthhires package. Please try installing the package for yourself using the following command: install.packages("rnaturalearthhires", repos = "http://packages.ropensci.org", type = "source")

install.packages("rnaturalearthhires", repos = "http://packages.ropensci.org", type = "source") Error in install.packages : error reading from connection

Session info is as follows:

sessionInfo() R version 4.1.2 (2021-11-01) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Monterey 12.2.1

Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

locale: [1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] rnaturalearth_0.1.0

loaded via a namespace (and not attached): [1] Rcpp_1.0.8 magrittr_2.0.2 units_0.8-0 tidyselect_1.1.2 lattice_0.20-45 R6_2.5.1 rlang_1.0.1 fansi_1.0.2
[9] dplyr_1.0.8 tools_4.1.2 grid_4.1.2 KernSmooth_2.23-20 utf8_1.2.2 cli_3.2.0 e1071_1.7-9 DBI_1.1.2
[17] ellipsis_0.3.2 class_7.3-19 assertthat_0.2.1 tibble_3.1.6 lifecycle_1.0.1 sf_1.0-6 crayon_1.5.0 purrr_0.3.4
[25] vctrs_0.3.8 glue_1.6.2 sp_1.4-6 proxy_0.4-26 compiler_4.1.2 pillar_1.7.0 generics_0.1.2 classInt_0.4-3
[33] pkgconfig_2.0.3

aneal01 avatar Mar 03 '22 12:03 aneal01

It is kind of hard to tell from your formatting, but did you try:

install.packages("rnaturalearthhires", repos = "http://packages.ropensci.org", type = "source")

Judging by this:

Error in install.packages : error reading from connection

I'd guess there was a network or internet error.

I just gave it a go and it successfully installed:

trying URL 'http://packages.ropensci.org/src/contrib/rnaturalearthhires_0.2.0.tar.gz'
Content type 'application/x-gzip' length 21922598 bytes (20.9 MB)
downloaded 20.9 MB

* installing *source* package 'rnaturalearthhires' ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package 'rnaturalearthhires'
    finding HTML links ... done
    coastlines                              html  
    countries                               html  
    map_units                               html  
    rnaturalearthhires                      html  
    sovereignty                             html  
    states                                  html  
** building package indices
** testing if installed package can be loaded from temporary location
*** arch - i386
*** arch - x64
** testing if installed package can be loaded from final location
*** arch - i386
*** arch - x64
** testing if installed package keeps a record of temporary installation path
* DONE (rnaturalearthhires)

mps9506 avatar Mar 30 '22 20:03 mps9506

I have experienced similar problems as those mentioned by aneal01 above, for installing "rnaturalearth": double free or corruption (out)

install.packages("rnaturalearth") Aborted (core dumped) ERROR: lazy loading failed for package ‘rnaturalearth’

  • removing ‘/home/dylan/R/x86_64-pc-linux-gnu-library/4.2/rnaturalearth’ Warning in install.packages : installation of package ‘rnaturalearth’ had non-zero exit status

and for

install.packages("rnaturalearth", repos = "http://packages.ropensci.org", type = "source")

*** caught segfault *** address 0x55b654000000, cause 'memory not mapped' An irrecoverable exception occurred. R is aborting now ... Segmentation fault (core dumped) ERROR: lazy loading failed for package ‘rnaturalearth’

  • removing ‘/home/dylan/R/x86_64-pc-linux-gnu-library/4.2/rnaturalearth’ Warning in install.packages : installation of package ‘rnaturalearth’ had non-zero exit status

Here is the sessionInfo

R version 4.2.0 (2022-04-22) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 20.04.4 LTS

Matrix products: default BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0 LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=es_CL.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=es_CL.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=es_CL.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=es_CL.UTF-8 LC_IDENTIFICATION=C

attached base packages: [1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached): [1] Rcpp_1.0.8.3 plyr_1.8.7 pillar_1.7.0 compiler_4.2.0 rgnparser_0.2.0
[6] iterators_1.0.14 class_7.3-20 sys_3.4 tools_4.2.0 uuid_1.1-0
[11] nlme_3.1-157 jsonlite_1.8.0 lifecycle_1.0.1 tibble_3.1.7 lattice_0.20-45
[16] pkgconfig_2.0.3 rlang_1.0.2 foreach_1.5.2 DBI_1.1.2 cli_3.3.0
[21] curl_4.3.2 crul_1.2.0 parallel_4.2.0 e1071_1.7-9 xml2_1.3.3
[26] dplyr_1.0.9 stringr_1.4.0 generics_0.1.2 vctrs_0.4.1 hms_1.1.1
[31] classInt_0.4-3 grid_4.2.0 tidyselect_1.1.2 data.table_1.14.2 reshape_0.8.9
[36] httpcode_0.3.0 glue_1.6.2 sf_1.0-7 R6_2.5.1 fansi_1.0.3
[41] conditionz_0.1.0 tzdb_0.3.0 readr_2.1.2 purrr_0.3.4 magrittr_2.0.3
[46] codetools_0.2-18 ellipsis_0.3.2 units_0.8-0 bold_1.2.0 assertthat_0.2.1
[51] taxize_0.9.100 ape_5.6-2 utf8_1.2.2 KernSmooth_2.23-20 stringi_1.7.6
[56] proxy_0.4-26 crayon_1.5.1 zoo_1.8-10

dylancraven avatar May 31 '22 23:05 dylancraven

One possible culprit might be using http instead of https. I received this same error (tried turning VPN off, restarting RStudio, etc.) and in the end was able to install it when I used:

install.packages("rnaturalearthhires", repos = "https://packages.ropensci.org", type = "source")

instead of the http url suggested by the error message. @aneal01 @dylancraven can you test this out?

sformel-usgs avatar Nov 28 '22 23:11 sformel-usgs

I ran into the same error today when trying the http link. Changing to https solved the problem and I was able to download and install. Imho the function check_rnaturalearthhires() and related should use https by default, as that's a safer protocol.

JoFAM avatar Dec 02 '22 14:12 JoFAM