Issues with Rlang during Swirl Installation - r

When installing Swirl using R Studio on Windows 10 (64-bit), the Swirl package installs but the running library (swirl) cannot be found. The system gives an error that rlang gets removed while installing Swirl:
Error in rlang() : could not find function "rlang"
install.packages("rlang")
Installing package into ‘C:/Users/***/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
There is a binary version available but the source
version is later:
binary source needs_compilation
rlang 0.3.2 0.3.3 TRUE
installing the source package ‘rlang’
trying URL 'https://cran.rstudio.com/src/contrib/rlang_0.3.3.tar.gz'
Content type 'application/x-gzip' length 859027 bytes (838 KB)
downloaded 838 KB
installing source package 'rlang' ...
** package 'rlang' successfully unpacked and MD5 sums checked
** libs
C:/PROGRA~1/R/R-35~1.3/etc/x64/Makeconf:230: warning: overriding recipe for target '.m.o'
C:/PROGRA~1/R/R-35~1.3/etc/x64/Makeconf:223: warning: ignoring old recipe for target '.m.o'
c:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-35~1.3/include" -DNDEBUG -I./lib/ -O2 -Wall -std=gnu99 -mtune=generic -c capture.c -o capture.o
process_begin: CreateProcess(NULL, c:/Rtools/mingw_64/bin/gcc -IC:/PROGRA~1/R/R-35~1.3/include -DNDEBUG -I./lib/ -O2 -Wall -std=gnu99 -mtune=generic -c capture.c -o capture.o, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [C:/PROGRA~1/R/R-35~1.3/etc/x64/Makeconf:208: capture.o] Error 2
ERROR: compilation failed for package 'rlang'

Related

gcc-8: command not found (while installing randomForest)

I'm trying to install "randomForest" on R 3.6.3 as below:
urlPackage <- "https://cran.r-project.org/src/contrib/Archive/randomForest/randomForest_4.6-14.tar.gz"
install.packages(urlPackage, repos=NULL, type="source")
(install.packages('randomForest') throws the error: package 'randomForest' is not available (for R version 3.6.3))
The lines above, however, give me the following error:
trying URL 'https://cran.r-project.org/src/contrib/Archive/randomForest/randomForest_4.6-14.tar.gz'
Content type 'application/x-gzip' length 80074 bytes (78 KB)
==================================================
downloaded 78 KB
* installing *source* package ‘randomForest’ ...
** package ‘randomForest’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -mtune=native -g -O2 -Wall -pedantic -Wconversion -c classTree.c -o classTree.o
/bin/sh: gcc-8: command not found
make: *** [classTree.o] Error 127
ERROR: compilation failed for package ‘randomForest’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/randomForest’
Warning in install.packages :
installation of package ‘/var/folders/66/3s4r17rx7ln0b1p8tyrmws780000gn/T//RtmpDOHynP/downloaded_packages/randomForest_4.6-14.tar.gz’ had non-zero exit status
Does anyone have any idea how to solve this? I'm on macOS Catalina (ver 10.15.7)
You should install the gcc8 tool:
sudo port install gcc8
Related Links
MacPorts - GCC8
YouTube - Install GCC 8 with Homebrew on macOS

Unable to install a package called 'hemp' in R

I am new to learning R and i get the following error while installing the package called 'hemp'. Its a package which is used in psychometric analysis. Can anyone tell me what causes this errror?
Downloading GitHub repo cddesja/hemp#master
Installing 1 packages: nloptr
Installing package into ‘C:/Users/UJJWAL/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
There is a binary version available but the
source version is later:
binary source needs_compilation
nloptr 1.2.2.1 1.2.2.2 TRUE
installing the source package ‘nloptr’
trying URL 'https://cran.rstudio.com/src/contrib/nloptr_1.2.2.2.tar.gz'
Content type 'application/x-gzip' length 2450931 bytes (2.3 MB)
downloaded 2.3 MB
* installing *source* package 'nloptr' ...
** package 'nloptr' successfully unpacked and MD5 sums checked
** using staged installation
**********************************************
WARNING: this package has a configure script
It probably needs manual configuration
**********************************************
** libs
*** arch - i386
/mingw32/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-4.0.2/include" -DNDEBUG -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c dummy.cpp -o dummy.o
/mingw32/bin/gcc -I"C:/PROGRA~1/R/R-4.0.2/include" -DNDEBUG -I"/i386/include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c init_nloptr.c -o init_nloptr.o
init_nloptr.c:35:10: fatal error: nlopt.h: No such file or directory
#include "nlopt.h"
^~~~~~~~~
compilation terminated.
make: *** [C:/PROGRA~1/R/R-4.0.2/etc/i386/Makeconf:222: init_nloptr.o] Error 1
ERROR: compilation failed for package 'nloptr'
* removing 'C:/Users/UJJWAL/Documents/R/win-library/4.0/nloptr'
Error: Failed to install 'hemp' from GitHub:
(converted from warning) installation of package ‘nloptr’ had non-zero exit status
Seems that it wouldbe a little harder to install nloptr on Windows. It require nlopt to be installed first. See this for more info: https://www.r-project.org/nosvn/pandoc/nloptr.html

r - f951: internal compiler error: Illegal instruction: 4

I'm trying to install MVN package:
> install.packages("MVN")
probando la URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/MVN_5.5.tgz'
Content type 'application/x-gzip' length 382369 bytes (373 KB)
==================================================
downloaded 373 KB
The downloaded binary packages are in
/var/folders/79/xxghr9tj65789879v41wrp6h0000gn/T//Rtmp4bpod5/downloaded_packages
but when I do library(MVN) it says me that Error: package or namespace load failed for ‘MVN’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): there is no package called ‘rrcov’
so when I try to install it:
> install.packages("rrcov")
There is a binary version available but the source version is later:
binary source needs_compilation
rrcov 1.4-4 1.4-7 TRUE
Do you want to install from sources the package which needs compilation? (Yes/no/cancel) yes
installing the source package ‘rrcov’
probando la URL 'https://cran.rstudio.com/src/contrib/rrcov_1.4-7.tar.gz'
Content type 'application/x-gzip' length 965680 bytes (943 KB)
==================================================
downloaded 943 KB
* installing *source* package ‘rrcov’ ...
** package ‘rrcov’ successfully unpacked and MD5 sums checked
** libs
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c R-rng4ftn.c -o R-rng4ftn.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c covOPW.c -o covOPW.o
gfortran -fPIC -g -O2 -c ds11.f -o ds11.o
gfortran: warning: couldn’t understand kern.osversion ‘15.6.0
f951: internal compiler error: Illegal instruction: 4
f951: internal compiler error: Abort trap: 6
gfortran: internal compiler error: Abort trap: 6 (program f951)
make: *** [ds11.o] Abort trap: 6
ERROR: compilation failed for package ‘rrcov’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rrcov’
Warning in install.packages :
installation of package ‘rrcov’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/79/xxghr9tj65789879v41wrp6h0000gn/T/Rtmp4bpod5/downloaded_packages’
I've searched how to fix that, installing XCode, reinstalling r, and nothing. I need this package to perfom some multivariate analysis for my thesis but I do not know how to fix it.
Any help will be appreciated.
Thanks!
I am using an iOS 10.11.6

Installing a cassandra package

I'm new to R and cassandra, I'm trying to install the rcassandra package. On the rforge.net site, it says to do:
> install.packages('RCassandra',,'http://www.rforge.net/')
Warning: unable to access index for repository http://www.rforge.net/src/contrib
Warning message:
package ‘RCassandra’ is not available (for R version 3.1.0)
Trying a different repository
> install.packages('RCassandra',repo='http://cran.cnr.Berkeley.edu/')
Installing package into ‘/home/as/R/x86_64-redhat-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository http://cran.cnr.Berkeley.edu/src/contrib/
Warning message:
package ‘RCassandra’ is not available (for R version 3.1.0)
I tried installing from command line, but that does'nt seem to work either:
> sudo R CMD INSTALL RCassandra_0.1\-3.tar.gz
* installing to library ‘/home/as/R/x86_64-redhat-linux-gnu-library/3.1’
* installing *source* package ‘RCassandra’ ...
** package ‘RCassandra’ successfully unpacked and MD5 sums checked
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c cass.c -o cass.o
cass.c:1: sorry, unimplemented: 64-bit mode not compiled in
make: *** [cass.o] Error 1
ERROR: compilation failed for package ‘RCassandra’
* removing ‘/home/as/R/x86_64-redhat-linux-gnu-library/3.1/RCassandra
So how do I install the package? I can see the package on the web sites

An error when install R package forecast on AWS instance

install.packages('forecast')
Installing package into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
trying URL 'http://cran.cnr.Berkeley.edu/src/contrib/forecast_5.4.tar.gz'
Content type 'application/x-gzip' length 150965 bytes (147 Kb)
opened URL
downloaded 147 Kb
installing source package ‘forecast’ ...
package ‘forecast’ successfully unpacked and MD5 sums checked
libs
g++ -m64 -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/RcppArmadillo/include" -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c calcBATS.cpp -o calcBATS.o
In file included from calcBATS.cpp:1:0:
calcBATS.h:36:27: fatal error: RcppArmadillo.h: No such file or directory
#include
^
compilation terminated.
make: * [calcBATS.o] Error 1
ERROR: compilation failed for package ‘forecast’
* removing ‘/usr/lib64/R/library/forecast’
The downloaded source packages are in
‘/tmp/RtmpJRX18M/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("forecast") :
installation of package ‘forecast’ had non-zero exit status
Looks like there is a missing package dependence, RcppArmadillo.
install.packages("RcppArmadillo")
Then:
install.packages('forecast')
add within your lifecycle configuration
conda install -y -c r r-forecast

Resources