choroplethr package in R won't load - r

I am trying to load the choroplethr package in R and keep getting an error message that I can't troubleshoot or understand. If someone could please provide me with a workaround to fix this that would be appreciated.
install.packages("choroplethr")
install.packages("choroplethrMaps")
library(choroplethr)
library(choroplethrMaps)
Loading required package: acs
Loading required package: stringr
Loading required package: XML
Attaching package: acs
The following object is masked from package:base:
apply
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘htmlTable’
In addition: Warning messages:
1: package ‘choroplethr’ was built under R version 3.2.5
2: package ‘stringr’ was built under R version 3.2.5
3: package ‘XML’ was built under R version 3.2.5
Error: package or namespace load failed for ‘choroplethr’
Thank you,
Kelly

I am the package author and unfortunately I often have users report errors like this.
Technically, when you install an R package all of the packages needed to run that package are supposed to automatically get installed. In practice, however, that does not always happen. The key part of the first error message you report is this:
Error ... there is no package called ‘htmlTable’
In response to that error message I would simply manually install the htmlTable package and then reinstall choroplethr:
install.packages("htmlTable")
install.packages("choroplethr")
Reading the comments from your initial question it seems like you were able to get past this error message but then ran into another one. Again, the key part of that error message seems to be the following:
Error ... there is no package called ‘rlang’
I would address this error in the same way. Ie type:
install.packages("rlang")
install.packages("choroplethr")
Again, I have no idea why errors like this seem to sporadically occur when people try to install choroplethr (and presumably other packages as well). However, the fix that always seems to work is manually installing the package which R complains it cannot find.

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.

Issue installing Hmisc in Rstudio and calling in the library

I've had the following error for the package Hmisc. I read another thread which asked more about the error message however it said not to post this as a comment. I've installed the package and received the following error when calling in the library:
> library(Hmisc)
Error: package or namespace load failed for ‘Hmisc’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
there is no package called ‘checkmate’
In addition: Warning message:
package ‘Hmisc’ was built under R version 3.4.4
I've tried deleting the install and then installing checkmate separately and manually installing this from a browser rather than through R directly. However the same error message is returning. Does anyone know how to overcome this? Or similar packages to Hmisc. I need to package for a wtd.quantile function.
install.packages('lattice')
library('lattice')
install.packages('survival')
library('survival')
install.packages('Formula')
library('Formula')
install.packages('ggplot2')
library('ggplot2')
install.packages('checkmate')
library('checkmate')
install.packages('htmlwidgets')
library('htmlwidgets')
install.packages('stringi')
library('stringi')
install.packages('Hmisc')
library('Hmisc')

Errors installing/loading package ‘adespatial’

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.

Error: package or namespace failed for 'ecospat'

I have seen similar questions for other packages and I have tried solutions offered in other posts, such as removing the package and installing it again, clearing global environment etc, but I still get the same error.
> library(ecospat)
Loading required package: ade4
Loading required package: ape
Loading required package: sp
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called ‘slam’
I have tried updating all packages in RStudio, to no avail. I am currently trying to run a Boosted Regression Tree for data I have. If I proceed with the above error, I end up getting:
Error: could not find function "ecospat.boyce"
Any help would be highly appreciated.
I was having the same error message but in my case, it was the package called latticeExtra the one missing on my computer. I tried installing that package but was not available from CRAN. Then, I looked for the tar.gz file and tried installing the package, an error message popped up saying I needed a most recent version of R. Finally, I updated my R version (from 3.5.3 to 3.6.3) and tried using the ecospat package, it worked!

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.

Resources