Errors installing/loading package ‘adespatial’ - r

I am trying to run the dbmem function on a large dataset using the adespatial package, but cannot get it to install. When I run install.package("adespatial), I get this message:
package ‘adespatial’ is available as a source package but not as a binary.
Why can't I install this package as a binary and how do I go about getting this package installed on my Mac (OS sierra version 10.12.6). I am running R studio with R version 3.1.2
Update
I also tried running
install.packages("adespatial",type = "source")
however when I try to load the library it still says the library is not found. There were also many errors in the install. I updated my version of R to 3.4.4 and now it will install with a few errors, but the library still will not come up.
When I attempt to load the library (library(adespatial)), I receive this error:
Error: package or namespace load failed for ‘adespatial’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): there is no package called ‘curl’

Bit hard to replicate your problem, but try to install curl; either the R package:
install.packages("curl")
or directly on your OS (can't help there, sorry, never had an OS).
Anyway, if package installation fails in R, it throws an (or more) error message(s). In your case, they will point to missing packages. Rerun install.packages("adespatial") and see there.

Related

Error 'there is no package called 'rio'' when using fviz_dend and fviz_cluster

I'm running an ACP on a dataset and when I tried to use fviz_dend or fviz_cluster on the hcpc result it returns this error:
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck =
vI[[i]]): there is no package called 'rio'
Libraries FactoMineR and factoextra are loaded, ggplot2 as well.
I tried to install rio package but I had another error:
Warning message: "dependency 'foreign' is not available"
There is a binary version available but the source version is later:
binary source needs_compilation rio 0.5.26 0.5.27 FALSE
installing the source package 'rio'
Warning message in install.packages("rio"): "installation of package
'rio' had non-zero exit status"
After that when I try to install library('rio') it returns an error :
there is no package called 'rio'
I've read the fviz_dend documentation and it never mention any rio.
What can I do to avoid this problem?
It looks like rio is a dependency of both FactoMineR and factoextra. You can see if this by running the following line.
library(packrat)
packrat:::recursivePackageDependencies("FactoMineR",lib.loc = .libPaths()[1])
#[79] "purrr" "quantreg" "readr" "readxl" "rematch" "rio"
The error might be dependent on your operating system, so probably need to see the full error message. You may not have the proper tools (like cmake, which you would need to install on your command line) installed on your system.
Thanck you for your help :)
I was using a jupyter notebook, now I've transfered my work on R studio and there is no more issue. I think it was linked to the operating system as you said.

Error while installing package kableExtra in R

I am trying to install kableExtra and get the following errors:
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck =
vI[[j]]) :
there is no package called 'hms'
ERROR: lazy loading failed for package 'kableExtra'
*removing 'C:/Users/Tim/Documents/R/win-library/3.2/kableExtra'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-32~1.5/bin/x64/R" CMD INSTALL -l "C:\Users\Tim\Documents\R\win-library\3.2"
C:\Users\Tim\AppData\Local\Temp\RtmpUJQfwD/downloaded_packages/kableExtra_0.9.0.
tar.gz' had status 1
Warning in install.packages :
installation of package ‘kableExtra’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\Tim\AppData\Local\Temp\RtmpUJQfwD\downloaded_packages’
How can I solve my problem? Thanks in advance!
it seems kableExtra depends on the package "hms" so try install it before with:
install.packages("hms")
or via rstudio interface:
packages -> install
and type in "hms"
also try this command:
install.packages("kableExtra", dependencies = TRUE)
If there appear problems like installing rlang or something similar, there is no general solution for this. You can try to (re)install rtools. Sometimes there are missing parts of r installations. My guess if R can't install a dependencie is, that some library or tools of the R environment are missing or wrongly installed which have to be detected.
You have a trouble with the dependency with the package "hms". I have not got how you are installing the r package, but you can either install it first and then try it again or start the installation with the option of download and install all required dependencies, in the second option you need to be online and allow the package manager to intall what is required.
Here is how it looks in RGui. I guess your are not using RGui.

loadNamespace error loading choroplethr package in R [duplicate]

I'm new with R, and I'm having some trouble loading the car library. I use Windows 8.1 (64 bit) and i'm working in 32 bit R environment. I downloaded the library just fine, but when i try to load the car library using library(car) the message i get is:
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()),
versionCheck = vI[[j]]) :
there is no package called ‘quantreg’
Error: package or namespace load failed for ‘car’
This message came up asking for several other libraries besides quantreg. I downloaded some of those other libraries in the hope that it would be enough to run car, but it doesn't stop asking for more libraries.
Has anyone had the same issue? This also happened to some people I know, using different operating systems, mostly Windows, but also Linux.
It seems that you did not install the dependencies automatically when you installed car. I'm assuming that you tried installing with Rstudio, which does not automatically install dependencies.
This SO post and this one should help you to install them automatically.
Try reinstalling with the command install.packages("car",dependencies=TRUE).
Additionally, in the future you can check the CRAN page to see the depends, imports, suggests, etc.

Revolution R Enterprise with R version 3.2.2 and caret package

I am using Revolution R Enterprise with R version 3.2.2 (2015-08-14)
when I am trying to installed library(caret) I got this error
library(caret)
Loading required package: ggplot2
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘Rcpp’
In addition: Warning messages:
1: package ‘caret’ was built under R version 3.2.5
2: package ‘ggplot2’ was built under R version 3.2.4
Error: package ‘ggplot2’ could not be loaded
please help me
I tried many things and every things but I still have this error
So, that warning is pretty common with R packages. It is just a disclosure of what version the package was tuned to when it was created. That does not mean the package did not install properly.So there are a few things that I do when this happens (and it happened to me at work today with the sp mapping package).
If you are in RStudio, use the tools to update all packages as well updating R itself, save everything in your script, close it up. Restart you entire computer.
Reinstall the packages you need with install.packages("packagename", dependencies= TRUE). If a package is dependent on another package, then you will catch it here.
Then go back through the console and see all of the dependent package names that installed with your new package and update those with dependencies=TRUE as well. It is possible the Rcpp is installed but needs another package to support your target package.
I would again properly quit R or RStudio and then reboot the computer again.
I know it seems like overkill, but it has worked miracles for me on many occasions. You need to start all the way at the beginning to make it happen.

Deleted httr, now can't reinstall, or load devtools

I was trying to install twitteR, but the install failed, saying I needed httr >0.6 and I only had 0.3.
I tried to update httr. However, I seemed to have to 2 versions simultaneously, and when I used library(twitteR) it still said I had httr 0.3 and needed 0.6 (sorry I don't have the exact error messages anymore, and can't replicate due to the problems below.)
So, I deleted httr with remove.packages('httr') (this was a mistake).
Now I cannot load devtools
> library(devtools)
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘httr’
Error: package or namespace load failed for ‘devtools’
or install packages
install.packages('httr')
'''Some lines skipped'''
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘httr’
Error: package or namespace load failed for ‘devtools’
Execution halted
I get the same error message as above when trying to install httr from a tarball with R CMD INSTALL.
I'm pretty stuck. Is it time for a clean R install?
And for future reference, how do I update httr?
My best guess -- you have something in your ~/.Rprofile that's attempting to load httr (or a package that uses httr) -- since surely, nothing in base R relies on httr.
I believe install.packages() launches an R sub-process (using the same arguments on load as the current session), which in turn will source that ~/.Rprofile, and cause the errors you are seeing.
If I am correct, one solution would be to move / comment out your ~/.Rprofile and restore it after re-installing httr. Alternatively, launching R with the --vanilla flag (to suppress any site / profile loading) should also help in alleviating the problem.
Running R as R --vanilla fixed the problem.
I could then install httr with
install.packages('httr')
And then loading devtools works and installing twitteR then works as well.

Resources