Error in installing R package "AppliedPredictiveModeling" - r

I am learning ML from Applied Predictive Modeling book, while installing AppliedPredictiveModeling package I am getting following error
install.packages("AppliedPredictiveModeling")
Package LibPath Version Priority Depends Imports LinkingTo Suggests Enhances License
License_is_FOSS License_restricts_use OS_type Archs MD5sum NeedsCompilation Built
I tried looking on Google and SO to resolve this but was unable to find any solution. Please tell me how to resolve this, I have never encountered this error before. I use RStudio on Windows 7.

I found that I was generating this error message when I mistakenly typed
installed.packages("Hmisc")
Instead of the (correct)
install.packages("Hmisc")

since no one was able to help me on this issue, I guess perhaps it was not a common problem, but I solved it finally by installing the package offline.

You are mistyping install.packages as installed.packages. That's all. Just use the correct install.packages() function.

I encountered the same error when attempting to install the car package using
install.packages("car")
The response / error message I got was:
Package LibPath Version Priority Depends Imports LinkingTo Suggests
Enhances License License_is_FOSS License_restricts_use OS_type Archs
MD5sum NeedsCompilation Built
I was in the middle of an R session (RStudio, on Windows 10) when I first attempted to install it.
I fixed it by closing RStudio, and then re-running
install.packages("car")
as the first command I ran upon reopening RStudio.
Perhaps not a definitive solution, but thought it might help others.

Restarting my computer worked for me.
I was having the same issue with:
install.packages('rpart.plot')
Just restarting Rstudio did not work.

Try setting the "dependencies" method to TRUE. That helped me when installing it.

Related

Difficulty installing a package in R linux, dalton_rqi

Downloaded package from below URL.
Attempted to install using below command; response shown.
library(dalton.rqi,lib.loc='/home/X/Desktop/')
Error: package ‘dalton.rqi’ was built before R 3.0.0: please re-install it
https://my.clevelandclinic.org/departments/anesthesiology/depts/outcomes-research/risk-quantification
It appears this is a compiled package that maybe I don't have the source for? Is there a way to force install of the package? I'm unable to install using Rstudio GUI in its current form as a zip. Tried repackaging to tar.gz has Rstudio was looking for and also had a non-zero exit status error.
Any ideas?
I'm afraid this can't be achieved directly. The error message says it well: to use a package in R it needs to be built on an R version matching yours.
I can suggest two ways to move forward:
Contact the authors, ask for the R sources (it is somewhat surprising they did not make them available in the first place), and build the package yourself.
Downgrade your R version as far back as needed to match the one this pre-built package used.

Error: package or namespace load failed for ‘arulesViz’: object ‘cividis’ is not exported by 'namespace:viridisLite'

In R 3.4.3 (Windows 10) while loading the packages arulesViz:
Error: package or namespace load failed for ‘arulesViz’: object ‘cividis’ is not exported by 'namespace:viridisLite'
I tried to uninstall and install, but did not help. What is wrong and how can i correct it?
Basically you need to install the dependencies of arulesViz.
I tried with Scatterplot3d , viznetwork, vcd, virdislite.
I also faced similar problem.
This problem can be resolved by installing package "viridisLite" along with "arulesViz"
for me it worked no need to reinstallthe R or Rstudio
It get solved , after reinstall RStudio + removed old version of R.
Disadvantage is all libraries will also get removed. So you have to load again.
I had the same issue with the seriation package. Ultimately I found that I just had to uninstall and reinstall r and r studio. Then i ran update.packages() and I had no problems.
This is a pain, as there are several packages with dependencies for packages which in turn import viridisLite, and this error is very opaque for users...
One thing I've found works (apart from manually install.packages("") each package mentioned in the error) is to switch repositories to the RStudio-maintained Cloud repo. (repo 0).
The problem seems to have hit people with a default repo that has incompatible versions of packages at the time people use it, and the cloud repo seems to avoid/not suffer from this problem.
Hope this helps

(More) DeclareDesign R Package download problems

I asked a similar question a couple months ago, but the package, website, and code in question have since been updated and the solution I used previously is no longer effective.
The issue is that I am unable to install a particular package in R.
The new code provided for installation of the DeclareDesign package is as follows (source):
install.packages("devtools")
devtools::install_github("DeclareDesign/DeclareDesign")
I've provided a screenshot of the error that I get when I try to run the above code. It looks to me like the problem is with the included 'estimatr' package, which apparently then causes the entire installation to fail.
How do I get this to work?
Your installation failed because devtools is trying to install estimatr from source, but you don't have the appropriate toolchain available to build it.
DeclareDesign now has a drat repository with pre-built binary packages for Mac and Windows, which should obviate the need to install Xcode or Rtools.
install.packages("DeclareDesign", repos="http://r.declaredesign.org")
DeclareDesign is now on CRAN, so you can install via
install.packages("DeclareDesign")

Use CSV-Import in RStudio fails installing dependencies

I just updated to RStudio 1.0.136 and tried to import a csv. Therefore it wants me to install a package called readr. If I try this, it fails installing its dependency on tibble with error message:
RcppExports.cpp:4:10: fatal error: 'Rcpp.h' file not found
#include <Rcpp.h>
^
Since this seems to be some problem with the package itself and the integration of C++ code, is there anything I can do beside filing a bug report?
I recognised that the error also occured for some other packages such as GGPLOT2. I updated my R version to 3.3 and all packages without success. Finally I ran brew uninstall --force R and brew install R, after that everything went fine. Now I have R version 3.4 installed (even that R reported before, that there was no newer version available).
It sounds like you need to update all of your packages. Go to tools, then check for package updates, and update everything. You should also check that you have the most current version of R installed. If neither of these solve your problem you might want to try reinstalling the Rccp package.

Package installation issues with R 3.1.0

My Fedora system (Fedora 20, all up to date) has just had R updated to version 3.1.0. Since then, I've had issues installing multiple packages. glmnet failed previously, and now I'm having trouble with treemap. More specifically, I get an error during treemap installation that httpuv has zero exit status.
I never had issues with the previous version of R. Any reason this version should have such problems??
There could be many causes to do with your OS, version, permissions, other installed packages/software, etc, etc. Without seeing the full error message it's hard to know.
One possibility specific to httpuv is root privileges. I've noticed a few threads on various forums when searching for installation errors with this package and Linux, many of them mentioning root v. non-root issues. In another case, libuv needed to be upgraded.
I encounter package installation problems daily and I have some more general work-arounds as well. Hopefully one of these will solve your problem.
Install the package from source
download.file(url="http://cran.r-project.org/src/contrib/httpuv_1.3.0.tar.gz", destfile = "httpuv.tar.gz")
install.packages("httpuv.tar.gz", type = "source", repos = NULL)
Install using devtools via GitHub if the package supports it
Install RTools and re-try your package installation
Install an older version of the package
If those above do not work, then I dig deeper by referring to advice given to me by a VP of IT in my company. These comments were made in reference to frequent package installation problems I encountered when switching from Windows to Solaris:
There are two types of install/make problems. Missing .h files
and/or missing .so/.a libs. The reason for these are multiple:
1.- the package that delivers these is not installed. This means that those files cannot be found anywhere in the /usr tree. Solution is
install right package, make sure the files are there
2.- the includes are not found by the install configurator. This means some environment variable or install option is not properly set (this
is our case for RODBC). Figuring out which variable to set is
challenging without looking at the package documentation [fortunately, documentation is not hard to find!]
3.- the libs are not in the LD_LIBRARY_PATH, easy to fix.
4.- There is a deeper compile/link error, meaning the package is not compatible with the rest of the sw, or has not been properly ported.

Resources