rnaturalearthhires package installation error - r

I am trying to install the rnaturalearthhires package but I am getting many errors.
Here is the first error:
Installing the rnaturalearthhires package.
Installing package into ‘C:/Users/kkost/OneDrive/Dokumenti/R/win-library/4.0’
(as ‘lib’ is unspecified)
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")
Then I try the following code:
install.packages("rnaturalearthhires", repos = "http://packages.ropensci.org", type = "source")
And I get this:
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/kkost/OneDrive/Dokumenti/R/win-library/4.0’
(as ‘lib’ is unspecified)
**Error in install.packages : error reading from connection**
Then I try this code:
devtools::install_github("ropensci/rnaturalearthhires")
but end up getting this:
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
namespace ‘rlang’ 0.4.8 is already loaded, but >= 0.4.10 is required
I also try this code:
install_github("ropensci/rnaturalearthhires")
But I get this:
Error in install_github("ropensci/rnaturalearthhires") :
could not find function "install_github"

I found this isssue, it might help:
https://github.com/ropensci/rnaturalearthhires/issues/2
install.packages("devtools") # I guess you also need this
devtools::install_github("ropensci/rnaturalearthhires")
library("rnaturalearth")

devtools can take a looong time to compile and install for some users. installation directly from github can now be done with the remotes package.
remotes::install_github("ropensci/rnaturalearthhires")

Related

library (ecospat) problem with biomod2 version

When I try to load 'ecospat' I find this problem:
> library(ecospat)
Error: package or namespace load failed for ‘ecospat’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
namespace ‘biomod2’ 4.1-2 is being loaded, but < 4.0 is required
So I have tried to load a 'biomod2' 3.5.1 version, but I can't because it's not available for my version of R (4.2.1)
> install.packages("D:/Descargas/biomod2_3.5.1")
Installing package into ‘C:/Users/danie/AppData/Local/R/win-library/4.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘D:/Descargas/biomod2_3.5.1’ is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
Someone could help me with this problem?
You can install the biomod2_3.5.1 package using the following code
install.packages("https://cran.r-project.org/src/contrib/Archive/biomod2/biomod2_3.5.1.tar.gz",
repo=NULL, type="source")

Error using library(dplyr) in Rstudio: there is no package called ‘lifecycle’

i am using this function:
test = as.data.frame (left_join (registerPers, pers, by = c ("RB030", "PB030")))
but rstudio gives me this error:
Error in left_join (registerPers, pers, by = c ("RB030", "PB030")):
I can't find the "left_join" function
despite having downloaded the dplyr package.
I actually find the problem by recalling the package:
library (dplyr)
Error: package or namespace load failed for 'dplyr' in loadNamespace (i, c (lib.loc, .libPaths ()), versionCheck = vI [[i]]):
there is no package called 'lifecycle'
how can i fix it?
I had this error and the above solution did not work for me. I also had the message. If you try
install.packages("lifecycle")
and get an error that looks like this:
WARNING: Rtools is required to build R packages but is not currently installed.
Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/student/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
also installing the dependencies ‘cli’, ‘rlang’
You will need to go to: https://cran.rstudio.com/bin/windows/Rtools/ and download the relevant version of RTools, once you have RTools installed rerun the
install.packages("lifecycle")
command and you should be able to now install it.

Is it possible to use package semPlot with R 3.6.2?

I upgraded R to version 3.6.2 and have discovered that package semPlot will not work. It installs without any problems, but when I try to load it I get the message,
Error: package or namespace load failed for ‘semPlot’ in
loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck =
vI[[j]]): there is no package called ‘ggm’
I then tried to install ggm but get the following warning and error:
Warning in install.packages : dependency ‘graph’ is not available
There is a binary version available but the source version is
later:
binary source needs_compilation ggm 2.3 2.5 FALSE installing the source package ‘ggm’ trying URL
'https://cran.rstudio.com/src/contrib/ggm_2.5.tar.gz' Content type
'application/x-gzip' length 109414 bytes (106 KB) downloaded 106 KB
ERROR: dependency ‘graph’ is not available for package ‘ggm’ removing
‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/ggm’
Warning in install.packages : installation of package ‘ggm’ had
non-zero exit status"
I then tried to install graph, but it says:
package ‘graph’ is not available (for R version 3.6.2).
I wondered if anyone else had experienced this problem, and had any solutions so I can load semPlot with R 3.6.2?
Many thanks.
I also have R 3.6.2 and get all errors you get. But when I try to install the semPlot package from GitHub, it works fine, as follows:
install.packages('devtools')
library(devtools)
install_github('SachaEpskamp/semPlot', dependencies = T)
library(semPlot)
Please not that I tried the cran/semPlot repository but didn't work for me, whereas SachaEpskamp/semPlot does.
Hope you get it working.

RShiny installation ERROR: lazy loading failed for package 'shiny'

I am trying to install the Shiny package, and I am getting this error
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
namespace 'httpuv' 1.4.1 is being loaded, but >= 1.4.4 is required
ERROR: lazy loading failed for package 'shiny'
* removing 'C:/Users/ikum/Documents/R/win-library/3.3/shiny'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.2/bin/x64/R" CMD INSTALL -l "C:\Users\ikum\Documents\R\win-library\3.3" C:\Users\ikum\AppData\Local\Temp\RtmpcbANIA/downloaded_packages/shiny_1.2.0.tar.gz' had status 1
Warning in install.packages :
installation of package ‘shiny’ had non-zero exit status
Even when I try to download the latest version of httpuv using the targz file, it is still going to the 1.4.1 version. I deleted httpuv as well and reinstalled it manually as well as from the CRAN repository. Nothing seems to be working.
I also have the latest version or RStudio and R.
Is there a solution to this?
You can try to add type = "binary" argument:
install.packages("shiny", type ="binary")

Can't install caret package in R

I have tried multiple ways to install the caret package in R.
The error message that I receive is as follows:
Error: package or namespace load failed for ‘caret’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘dimRed’
When I try to install dimRed, I get the following message:
Installing package into ‘C:/Users/Thomas/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
Warning in install.packages :
dependency ‘Biobase’ is not available
There is a binary version available but the source version is later:
binary source needs_compilation
dimRed 0.1.0 0.2.1 FALSE
installing the source package ‘dimRed’
trying URL 'https://cran.rstudio.com/src/contrib/dimRed_0.2.1.tar.gz'
Content type 'application/x-gzip' length 363025 bytes (354 KB)
downloaded 354 KB
ERROR: dependency 'Biobase' is not available for package 'dimRed'
* removing 'C:/Users/Thomas/Documents/R/win-library/3.4/dimRed'
In R CMD INSTALL
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-34~1.4/bin/x64/R" CMD INSTALL -l "C:\Users\Thomas\Documents\R\win-library\3.4" C:\Users\Thomas\AppData\Local\Temp\RtmpqKhsKn/downloaded_packages/dimRed_0.2.1.tar.gz' had status 1
Warning in install.packages :
installation of package ‘dimRed’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\Thomas\AppData\Local\Temp\RtmpqKhsKn\downloaded_packages’
Per previous posts, I have updated RStudio. I have attempted an install from install_url.
Any suggestions are welcome.
I was able to figure this out.
Simply typing install.packages won't work. In order to install Biobase, you have to run the following code in R console:
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("Biobase", version = "3.8")
More info: https://bioconductor.org/packages/release/bioc/html/Biobase.html
Once this step is done, I installed caret again using
install.packages("caret",dependencies = T)
And then it worked.
Warning ...
install.packages("BiocManager")
This only works if your R version is >= 3.5.0
for info I've the same problem under a Centos and a Windows.
issue solved on the windows with 3.5.1 R version. Not yet solved on the centOS (3.4.2)

Resources