Installing factoextra package in R - r

I am using R version >3.5. I want to install factoextra package on R studio (I use Mac). I tried to install the package directly with dependencies = TRUE, and I also tried to install the dependencies packages one by one. Neither worked.
Here is the error message: (* represents the user on my computer).
* installing *source* package ‘quantreg’ ...
** package ‘quantreg’ successfully unpacked and MD5 sums checked
** libs
/Users/*/.R/Makevars:2: *** missing separator. Stop.
ERROR: compilation failed for package ‘quantreg’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/quantreg’
* installing *source* package ‘mclust’ ...
** package ‘mclust’ successfully unpacked and MD5 sums checked
** libs
/Users/*/.R/Makevars:2: *** missing separator. Stop.
ERROR: compilation failed for package ‘mclust’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/mclust’
ERROR: dependencies ‘pbkrtest’, ‘quantreg’ are not available for package ‘car’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/car’
ERROR: dependency ‘car’ is not available for package ‘rstatix’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rstatix’
ERROR: dependency ‘rstatix’ is not available for package ‘ggpubr’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/ggpubr’
ERROR: dependency ‘ggpubr’ is not available for package ‘factoextra’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/factoextra’
The downloaded source packages are in:
‘/private/var/folders/8v/mfj4t9t54y72cdrz6q84jnjh0000gn/T/RtmpfEwO54/downloaded_packages’
Warning messages:
1: In install.packages("factoextra", dependencies = TRUE) :
installation of package ‘quantreg’ had non-zero exit status
2: In install.packages("factoextra", dependencies = TRUE) :
installation of package ‘mclust’ had non-zero exit status
3: In install.packages("factoextra", dependencies = TRUE) :
installation of package ‘car’ had non-zero exit status
4: In install.packages("factoextra", dependencies = TRUE) :
installation of package ‘rstatix’ had non-zero exit status
5: In install.packages("factoextra", dependencies = TRUE) :
installation of package ‘ggpubr’ had non-zero exit status
6: In install.packages("factoextra", dependencies = TRUE) :
installation of package ‘factoextra’ had non-zero exit status
any help would be greatly appreciated!!

R packages come in two shapes: as pre-compiled binaries, and as source code. In your case, it seems that the compilation of mclust and quantreg failed, as suggested by the error message
Stop. ERROR: compilation failed for package ‘mclust’
Stop. ERROR: compilation failed for package ‘quantreg’
You could try to force install them from binary by running: install.packages("mclust", type = "binary") and install.packages("quantreg", type = "binary")

Related

R - Why can I not install devtools and neither some of its dependencies?

I am trying to install devtools and I think the problem is with its dependencies. I also tried to singularly install processx but I got still error. Thank you so much.
* installing *source* package ‘processx’ ...
** package ‘processx’ successfully unpacked and MD5 sums checked
** libs
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package ‘processx’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/processx’
Warning in install.packages :
installation of package ‘processx’ had non-zero exit status
Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
unknown timezone 'zone/tz/2019c.1.0/zoneinfo/Asia/Bangkok'
* installing *source* package ‘usethis’ ...
** package ‘usethis’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
namespace ‘fs’ 1.2.7 is being loaded, but >= 1.3.0 is required
ERROR: lazy loading failed for package ‘usethis’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/usethis’
Warning in install.packages :
installation of package ‘usethis’ had non-zero exit status
ERROR: dependency ‘processx’ is not available for package ‘callr’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/callr’
Warning in install.packages :
installation of package ‘callr’ had non-zero exit status
ERROR: dependency ‘callr’ is not available for package ‘pkgbuild’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/pkgbuild’
Warning in install.packages :
installation of package ‘pkgbuild’ had non-zero exit status
ERROR: dependencies ‘callr’, ‘pkgbuild’ are not available for package ‘rcmdcheck’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rcmdcheck’
Warning in install.packages :
installation of package ‘rcmdcheck’ had non-zero exit status
ERROR: dependencies ‘usethis’, ‘callr’, ‘pkgbuild’, ‘rcmdcheck’ are not available for package ‘devtools’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/devtools’
Warning in install.packages :
installation of package ‘devtools’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/75/5wf3rrn96jj16b19vf_5j_600000gn/T/RtmpTQ6FNv/downloaded_packages’

Problem installing RVAideMEmoire in R 3.6.3 Ubuntu 18.04 and "car" packages (curl, rio, FactormineR, alr4, rgl)

I have problems installing RVAideMemoire packages. It gives me errors saying "car" is not available. When I try to install "car", then I have the following errors
Can somebody help me? thanks a lot
ERROR: configuration failed for package ‘rgl’
* removing ‘/home/anna/R/x86_64-pc-linux-gnu-library/3.6/rgl’
ERROR: dependency ‘curl’ is not available for package ‘rio’
* removing ‘/home/anna/R/x86_64-pc-linux-gnu-library/3.6/rio’
ERROR: dependency ‘rio’ is not available for package ‘car’
* removing ‘/home/anna/R/x86_64-pc-linux-gnu-library/3.6/car’
ERROR: dependency ‘car’ is not available for package ‘alr4’
* removing ‘/home/anna/R/x86_64-pc-linux-gnu-library/3.6/alr4’
The downloaded source packages are in
‘/tmp/Rtmpet3m65/downloaded_packages’
Warning messages:
1: In install.packages("car", dep = T) :
installation of package ‘curl’ had non-zero exit status
2: In install.packages("car", dep = T) :
installation of package ‘rgl’ had non-zero exit status
3: In install.packages("car", dep = T) :
installation of package ‘rio’ had non-zero exit status
4: In install.packages("car", dep = T) :
installation of package ‘car’ had non-zero exit status
5: In install.packages("car", dep = T) :
installation of package ‘alr4’ had non-zero exit status

Error in installing packages 'stringr', 'reshape2', and 'ggplot2', and 'rattle' on mac

I am not a Mac user, but I am trying to help some students to install rattle on their Mac systems. I suggest them to follow zhiyzuo post, which is based on Yihui’s comment. But they get the following errors, although 'brew' is installed on their system:
* installing *source* package ‘stringr’ ...
** package ‘stringr’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error in library.dynam(lib, package, package.lib) :
shared object ‘stringi.so’ not found
ERROR: lazy loading failed for package ‘stringr’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/stringr’
Warning in install.packages :
installation of package ‘stringr’ had non-zero exit status
ERROR: dependency ‘stringr’ is not available for package ‘reshape2’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/reshape2’
Warning in install.packages :
installation of package ‘reshape2’ had non-zero exit status
ERROR: dependency ‘reshape2’ is not available for package ‘ggplot2’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/ggplot2’
Warning in install.packages :
installation of package ‘ggplot2’ had non-zero exit status
ERROR: dependencies ‘ggplot2’, ‘stringr’ are not available for package ‘rattle’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rattle’
Warning in install.packages :
installation of package ‘rattle’ had non-zero exit status

installation of package ‘ggvis’ had non-zero exit status

I'm on Ubuntu 12.04.5 and have R v.3.1.3 installed.
I'm using the command
install.packages("ggvis")
And that yields
ERROR: dependency ‘mime’ is not available for package ‘shiny’
* removing ‘/home/milia/R/x86_64-pc-linux-gnu-library/3.1/shiny’
ERROR: dependency ‘shiny’ is not available for package ‘ggvis’
* removing ‘/home/milia/R/x86_64-pc-linux-gnu-library/3.1/ggvis’
The downloaded source packages are in
‘/tmp/Rtmp6Cz9En/downloaded_packages’
Warning messages:
1: In install.packages("ggvis") :
installation of package ‘shiny’ had non-zero exit status
2: In install.packages("ggvis") :
installation of package ‘ggvis’ had non-zero exit status
So I figured I had to install shiny first. So I typed
install.packages("shiny")
Which gave:
ERROR: dependency ‘mime’ is not available for package ‘shiny’
* removing ‘/home/milia/R/x86_64-pc-linux-gnu-library/3.1/shiny’
The downloaded source packages are in
‘/tmp/Rtmp6Cz9En/downloaded_packages’
Warning message:
In install.packages("shiny") :
installation of package ‘shiny’ had non-zero exit status
So I thought installing mime.
Did as usual
install.packages("mime")
Which gave
Warning message:
In install.packages("mime") :
installation of package ‘mime’ had non-zero exit status
I'm not sure what to do next, and the similar problems in stack with a non-zero exit status didn't help much.
My Rprofile can be found here.

Error installing ggplot2

I was trying to run a simple code on ggplot2 and got the following error:
source("u1.txt")
Error in library(ggplot2) : there is no package called ‘ggplot2’
Error : package ‘foreign’ was built before R 3.0.0: please re-install it
ERROR: lazy loading failed for package ‘maptools’
* removing ‘/home/shivangi/R/i686-pc-linux-gnu-library/3.0/maptools’
* installing *source* package ‘multcomp’ ...
** package ‘multcomp’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** demo
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (multcomp)
ERROR: dependencies ‘plyr’, ‘reshape2’, ‘scales’ are not available for package ‘ggplot2’
* removing ‘/home/shivangi/R/i686-pc-linux-gnu-library/3.0/ggplot2’
The downloaded source packages are in
‘/tmp/RtmpOGWrr4/downloaded_packages’
Warning messages:
1: In install.packages("ggplot2", dep = TRUE) :
installation of package ‘Rcpp’ had non-zero exit status
2: In install.packages("ggplot2", dep = TRUE) :
installation of package ‘plyr’ had non-zero exit status
3: In install.packages("ggplot2", dep = TRUE) :
installation of package ‘testthat’ had non-zero exit status
4: In install.packages("ggplot2", dep = TRUE) :
installation of package ‘reshape2’ had non-zero exit status
5: In install.packages("ggplot2", dep = TRUE) :
installation of package ‘scales’ had non-zero exit status
6: In install.packages("ggplot2", dep = TRUE) :
installation of package ‘Hmisc’ had non-zero exit status
7: In install.packages("ggplot2", dep = TRUE) :
installation of package ‘maptools’ had non-zero exit status
8: In install.packages("ggplot2", dep = TRUE) :
installation of package ‘ggplot2’ had non-zero exit status
I had the same error running ggplot this evening, essentially you need to try to install all the dependencies that failed. For me it was "scales", then "munsell" and then finally (the actual problem) "colorspace" which hadn't be updated since I upgraded to 3.1.1. In your case, it looks like you want to first try installing "foreign" and then try ggplot2 again. Keep loading dependencies that error manually until you find the real problem.
You can specify that the install.packages() call also install all dependent packages:
if(!require(ggplot2)) install.packages('dplyr',dependencies = TRUE)
the above code first checks to see if ggplot2 package is loaded, if not it tries to load the apckage. If it cannot load the package, it then tries to install the package and all of package its dependencies.
With RTools installed, I got this to work:
install.packages("ggplot2", type="source",dependencies = TRUE)
Compiled a few packages...
Make sure your PATH is updated to point to RTools properly, i.e. includes
c:\Rtools\bin;c:\Rtools\gcc-4.6.3\bin
at the front.
I am using Rtools32.exe

Resources