R cannot download websockets package from the github - r

The manual is written here:https://github.com/Refinitiv/websocket-api/tree/master/Applications/Examples/R
The mentioned code is written in Section 2 of Install libraries
Problems are with this part
library(devtools)
install_github("brettjbush/R-Websockets")
With R and RTools versions above 4.0 I have following error.
> install_github("brettjbush/R-Websockets")
Downloading GitHub repo brettjbush/R-Websockets#HEAD
Installing 1 packages: caTools
Installing package into ‘\\energia.sise/dfs/REDIRECT/german.suhharukov/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/caTools_1.18.0.zip'
Content type 'application/zip' length 317292 bytes (309 KB)
downloaded 309 KB
package ‘caTools’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\german.suhharukov\AppData\Local\Temp\RtmpoRYGc0\downloaded_packages
√ checking for file 'C:\Users\german.suhharukov\AppData\Local\Temp\RtmpoRYGc0\remotes1aa03e212c08\brettjbush-R-Websockets-fc7ee9c/DESCRIPTION' (1s)
- preparing 'websockets':
√ checking DESCRIPTION meta-information ...
- cleaning src
Warning in system2(command, args, stdout = NULL, stderr = NULL, ...) :
'CreateProcess' failed to run 'C:\rtools40\usr\bin\make.exe -f "C:/PROGRA~1/R/R-40~1.3/share/make/clean.mk" -f Makevars.win clean'
- checking for LF line-endings in source and make files and shell scripts
- checking for empty or unneeded directories
- building 'websockets_1.1.7.tar.gz'
Installing package into ‘\\sise/dfs/REDIRECT/MYNAME/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
'\\sise\dfs\REDIRECT\MYNAME\Documents'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
* installing *source* package 'websockets' ...
** using staged installation
** libs
*** arch - i386
Error in system(cmd) :
(converted from warning) 'CreateProcess' failed to run 'C:\rtools40\usr\bin\make.exe -f "Makevars.win" -f "C:/PROGRA~1/R/R-40~1.3/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-40~1.3/share/make/winshlib.mk" SHLIB="websockets.dll" OBJECTS="libsock.o"'
* removing '\\sise/dfs/REDIRECT/MYNAME/Documents/R/win-library/4.0/websockets'
Error: Failed to install 'websockets' from GitHub:
(converted from warning) installation of package ‘C:/Users/MYNAME/AppData/Local/Temp/RtmpoRYGc0/file1aa0518554ea/websockets_1.1.7.tar.gz’ had non-zero exit status
> install.packages("caTools")
Installing package into ‘\\sise/dfs/REDIRECT/MYNAME/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/caTools_1.18.0.zip'
Content type 'application/zip' length 317292 bytes (309 KB)
downloaded 309 KB
package ‘caTools’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\MYNAME\AppData\Local\Temp\XXXXXXX\downloaded_packages
>
Errors are following
> library(devtools)
Loading required package: usethis
> install_github("brettjbush/R-Websockets")
Downloading GitHub repo brettjbush/R-Websockets#master
trying URL 'https://cran.rstudio.com/bin/windows/Rtools/Rtools35.exe'
Content type 'application/x-msdownload' length 108622512 bytes (103.6 MB)
downloaded 103.6 MB
Error: Failed to install 'websockets' from GitHub:
Could not find tools necessary to compile a package
Call `pkgbuild::check_build_tools(debug = TRUE)` to diagnose the problem.
> pkgbuild::check_build_tools(debug = TRUE)
trying URL 'https://cran.rstudio.com/bin/windows/Rtools/Rtools35.exe'
Content type 'application/x-msdownload' length 108622512 bytes (103.6 MB)
downloaded 103.6 MB
Error: Could not find tools necessary to compile a package
Call `pkgbuild::check_build_tools(debug = TRUE)` to diagnose the problem.
> find_rtools()
[1] TRUE
> Sys.which("ls.exe")
ls.exe
"C:\\Rtools\\bin\\ls.exe"
How can I download this package?

In the notes on github it says "NOTE: This package is no longer maintained. For implementing websocket servers in R, try the httpuv package"
Another possible problem could be that you are running a new version of R with an old version of Rtools. So I'd try to install the newest version of Rtools or run an older version of R with a compatible version of Rtools, such that you can build and compile the package.
I ran your code on my machine running R 4.0.2 and Rtools 4.0.0 and did not face any issues installing the package. So I'd suggest installinng the newest version of R and Rtools from here: https://cran.r-project.org/bin/windows/Rtools/ and trying again.

Related

Unable to install package RGLPK with R Studio Server in AWS

I am trying to install the package RGLPK with an AWS EC2 instance which has R Studio 1.3 and R 4.0 running. I get this result:
> install.packages("Rglpk")
Installing package into ‘/home/rstudio/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/Rglpk_0.6-4.tar.gz'
Content type 'application/x-gzip' length 21753 bytes (21 KB)
==================================================
downloaded 21 KB
* installing *source* package ‘Rglpk’ ...
** package ‘Rglpk’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
/bin/bash: line 0: cd: GLPK: No such file or directory
Makevars:10: recipe for target 'GLPK.ts' failed
make: *** [GLPK.ts] Error 1
ERROR: compilation failed for package ‘Rglpk’
* removing ‘/home/rstudio/R/x86_64-pc-linux-gnu-library/4.0/Rglpk’
Warning in install.packages :
installation of package ‘Rglpk’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpHmQk09/downloaded_packages’
I have found numerous similar errors involving this package. Such as this:
GLPK: No such file or directory error when trying to install R package
There seems to be 3 or 4 solutions, but they involve sudo commands from the terminal window. I am in a virtual machine.
This worked:
In the terminal within R Studio Server:
sudo apt install libglpk-dev
And back in the console, install the R library:
install.packages("Rglpk")
Credit: #AdamErickson from this post:
GLPK: No such file or directory error when trying to install R package

R rJava will not install on Windows 10

I am trying to install RWeka in RStudio 1.2.5033
I have tried many different ways to install it, I re-installed Java64. Here is my latest try:
install.packages("rJava")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/Jesse's PC/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
rJava 0.9-12 0.9-13 TRUE
installing the source package ‘rJava’
trying URL 'https://cran.rstudio.com/src/contrib/rJava_0.9-13.tar.gz'
Content type 'application/x-gzip' length 664898 bytes (649 KB)
downloaded 649 KB
* installing *source* package 'rJava' ...
** package 'rJava' successfully unpacked and MD5 sums checked
** using staged installation
Generate Windows-specific files (src/jvm-w32) ...
make: Entering directory '/c/Users/JESSE'~1/AppData/Local/Temp/RtmpuOekjT/R.INSTALL24344ae86868/rJava/src/jvm-w32'
c:/Rtools/mingw_64/bin/dlltool --as c:/Rtools/mingw_64/bin/as --input-def jvm64.def --kill-at --dllname jvm.dll --output-lib libjvm.dll.a
make: c:/Rtools/mingw_64/bin/dlltool: Command not found
make: *** [Makefile:20: libjvm.dll.a] Error 127
make: Leaving directory '/c/Users/JESSE'~1/AppData/Local/Temp/RtmpuOekjT/R.INSTALL24344ae86868/rJava/src/jvm-w32'
ERROR: configuration failed for package 'rJava'
* removing 'C:/Users/Jesse's PC/Documents/R/win-library/3.6/rJava'
* restoring previous 'C:/Users/Jesse's PC/Documents/R/win-library/3.6/rJava'
Warning in install.packages :
installation of package ‘rJava’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\Jesse's PC\AppData\Local\Temp\Rtmps5Y5TC\downloaded_packages’

Cannot install R-package gdtools or ggiraph in conda after upgrading to OS X Catalina

After upgrading to OS X Catalina and re-installing R (since OS X now have completely migrated to 64-bit), I cannot install the packages ggiraph or gdtools. I have managed to install other packages such as ggplot2 without problem, but these doesn't work for some reason. I am hoping that someone here can help me out.
If I try to install it in R from GitHub I get:
devtools::install_github('davidgohel/ggiraph')
Pop-up:
"Install Build Tools
Building R package from source requires installation of additional build tools.
Do you want to install the additional tools now?"
But I have already install Xcode, so I don't know why I get this...
If I try to install it from CRAN I get:
install.packages("ggiraph")
also installing the dependencies ‘systemfonts’, ‘gdtools’, ‘uuid’
trying URL 'https://cran.rstudio.com/src/contrib/systemfonts_0.1.1.tar.gz'
Content type 'application/x-gzip' length 24379 bytes (23 KB)
==================================================
downloaded 23 KB
trying URL 'https://cran.rstudio.com/src/contrib/gdtools_0.2.1.tar.gz'
Content type 'application/x-gzip' length 32043 bytes (31 KB)
==================================================
downloaded 31 KB
trying URL 'https://cran.rstudio.com/src/contrib/uuid_0.1-2.tar.gz'
Content type 'application/x-gzip' length 46706 bytes (45 KB)
==================================================
downloaded 45 KB
trying URL 'https://cran.rstudio.com/src/contrib/ggiraph_0.7.0.tar.gz'
Content type 'application/x-gzip' length 372907 bytes (364 KB)
==================================================
downloaded 364 KB
installing source package ‘systemfonts’ ...
package ‘systemfonts’ successfully unpacked and MD5 sums checked
using staged installation
Using PKG_CFLAGS=
Using PKG_LIBS=-lfreetype
./configure: line 54: x86_64-apple-darwin13.4.0-clang: command not found
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because freetype2 was not found. Try installing:
deb: libfontconfig1-dev (Debian, Ubuntu, etc)
rpm: fontconfig-devel (Fedora, EPEL)
csw: fontconfig_dev (Solaris)
brew: freetype (OSX)
If freetype2 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a freetype2.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
ERROR: configuration failed for package ‘systemfonts’
* removing ‘/Users/USER/Anaconda3/anaconda3/lib/R/library/systemfonts’
Warning in install.packages :
installation of package ‘systemfonts’ had non-zero exit status
* installing source package ‘uuid’ ...
* package ‘uuid’ successfully unpacked and MD5 sums checked
* using staged installation
checking for gcc... x86_64-apple-darwin13.4.0-clang
checking whether the C compiler works... no
configure: error: in /private/var/folders/fy/d14lc6rd5nq827m06zkkb1_h0000gn/T/RtmpQUHJ12/R.INSTALL29ed73b7d534/uuid':
configure: error: C compiler cannot create executables
Seeconfig.log' for more details
ERROR: configuration failed for package ‘uuid’
* removing ‘/Users/USER/Anaconda3/anaconda3/lib/R/library/uuid’
Warning in install.packages :
installation of package ‘uuid’ had non-zero exit status
ERROR: dependency ‘systemfonts’ is not available for package ‘gdtools’
* removing ‘/Users/USER/Anaconda3/anaconda3/lib/R/library/gdtools’
Warning in install.packages :
installation of package ‘gdtools’ had non-zero exit status
ERROR: dependencies ‘gdtools’, ‘uuid’ are not available for package ‘ggiraph’
* removing ‘/Users/USER/Anaconda3/anaconda3/lib/R/library/ggiraph’
Warning in install.packages :
installation of package ‘ggiraph’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/fy/d14lc6rd5nq827m06zkkb1_h0000gn/T/RtmpKdtLil/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
If I try to install it from Terminal I get:
conda install -c conda-forge r-ggiraph
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: \
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
Examining backports.functools_lru_cache: 14%|▏| 87/641 [00:00<00:00, 1400.70it/
Examining bcrypt: 14%|███ | 88/641 [00:00<00:00, 1403.40it/s]
Examining sphinxcontrib-serializinghtml: 17%|▏| 106/641 [00:00<00:00, 1307.92it
Examining nss: 17%|████ | 107/641 [00:00<00:00, 1310.62it/s]
Examining clangdev: 22%|████▎ | 144/641 [00:00<00:00, 1233.48it/s]
/ mparing specs that have this dependenc-...**
... and the list of conflicts goes on and on and on...
Any ideas?

Trouble installing glmmadmb in R

I am having trouble installing glmmADMB package and hoping to get some help here. I've talked to people I know who uses R but we couldn't figure this out.
Looks like the error is about a symbol in the directory. However, the ' is included as a default naming convention in Windows and I can't seem to change the folder name. I name my computer Vanessa and it automatically give the user folder name "Vanessa's PC". [It might not due to this error, since I have ran some other codes that included this symbol in the command.] Any suggestions or thoughts would be greatly appreciated.
This is the log I got:
install.packages("glmmADMB",
+ repos=c("http://glmmadmb.r-forge.r-project.org/repos",
+ getOption("repos")),
+ type="source")
Installing package into ‘C:/Users/Vanessa's PC/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'http://glmmadmb.r-forge.r-project.org/repos/src/contrib/glmmADMB_0.8.3.3.tar.gz'
Content type 'application/x-gzip' length 9391177 bytes (9.0 MB)
downloaded 9.0 MB
installing source package 'glmmADMB' ...
** R
** data
* moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Warning: package 'MASS' was built under R version 3.4.4
** help
* installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* arch - i386
Error: unexpected symbol in "tools:::.test_load_package('glmmADMB', 'C:/Users/Vanessa's"
Execution halted
* arch - x64
Error: unexpected symbol in "tools:::.test_load_package('glmmADMB', 'C:/Users/Vanessa's"
Execution halted
ERROR: loading failed for 'i386', 'x64'
removing 'C:/Users/Vanessa's PC/Documents/R/win-library/3.4/glmmADMB'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-34~1.1/bin/x64/R" CMD INSTALL -l "C:\Users\Vanessa's PC\Documents\R\win-library\3.4" C:\Users\VANESSA'S~1\AppData\Local\Temp\Rtmp2piXfe/downloaded_packages/glmmADMB_0.8.3.3.tar.gz' had status 1
Warning in install.packages :
installation of package ‘glmmADMB’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\Vanessa's PC\AppData\Local\Temp\Rtmp2piXfe\downloaded_packages’
Try installing the devtools package first and then installing glmmADMB directly from the development version on GitHub:
> library(devtools)
> devtools::install_github("bbolker/glmmadmb")
Downloading GitHub repo bbolker/glmmadmb#master
from URL https://api.github.com/repos/bbolker/glmmadmb/zipball/master
Installing glmmADMB
Installing 1 package: R2admb
Installing package into ‘C:/Users/User/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
trying URL
'https://cran.rstudio.com/bin/windows/contrib/3.4/R2admb_0.7.16.zip'
Content type 'application/zip' length 505317 bytes (493 KB)
downloaded 493 KB
package ‘R2admb’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\User\AppData\Local\Temp\Rtmp4WWJZp\downloaded_packages
"C:/PROGRA~1/R/R-34~1.4/bin/x64/R" --no-site-file --no-environ
--no-save -- no-restore --quiet CMD INSTALL \
"C:/Users/User/AppData/Local/Temp/Rtmp4WWJZp/devtools28d0200a7e9b/bbolker-
glmmadmb-ac75f73" \
--library="C:/Users/User/Documents/R/win-library/3.4" --install-tests
* installing *source* package 'glmmADMB' ...
....
> library(glmmADMB)
Loading required package: MASS
Attaching package: ‘glmmADMB’
The following object is masked from ‘package:MASS’:
stepAIC
The following object is masked from ‘package:stats’:
step
This works:
install.packages("R2admb")
install.packages("glmmADMB",
repos=c("http://glmmadmb.r-forge.r-project.org/repos",
getOption("repos")),
type="source")
library(glmmADMB)

Unable to install sandwich package: installation of package ‘sandwich’ had non-zero exit status

I need to install the "plm" package. After installing it, the "sandwich" package was missing.
> library(plm)
Error: package or namespace load failed for ‘plm’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘sandwich
Tried to install the "sandwich" package, returned with this:
Installing package into ‘library_path’
(as ‘lib’ is unspecified)
also installing the dependency ‘zoo’
There is a binary version available but the source version is later:
binary source needs_compilation
sandwich 2.3-4 2.4-0 FALSE
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/zoo_1.8-0.zip'
Content type 'application/zip' length 901864 bytes (880 KB)
downloaded 880 KB
package ‘zoo’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\directory\downloaded_packages
installing the source package ‘sandwich’
trying URL 'https://cran.rstudio.com/src/contrib/sandwich_2.4-0.tar.gz'
Content type 'application/x-gzip' length 1280592 bytes (1.2 MB)
downloaded 1.2 MB
'\\directory\My Documents'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
* installing *source* package 'sandwich' ...
** package 'sandwich' successfully unpacked and MD5 sums checked
** R
** data
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
Warning in file(con, "w") :
cannot open file '\\library_path/sandwich/doc/index.html': No such file or directory
Error in file(con, "w") : cannot open the connection
ERROR: installing vignettes failed
* removing '\\library_path/sandwich'
Warning in install.packages :
running command '"C:/R-34~1.1/bin/x64/R" CMD INSTALL -l "\\library_path" C:\directory/downloaded_packages/sandwich_2.4-0.tar.gz' had status 1
Warning in install.packages :
installation of package ‘sandwich’ had non-zero exit status
The downloaded source packages are in
‘C:\directory\downloaded_packages’
Had tried:
Reinstall R and RStudio directly to C (not in C:\Program Files)
Using this command to install all the dependencies:
install.packages("sandwich", dependencies=TRUE)
Still, the "non-zero exit status" appeared. Do you have any suggestions?
I am using Windows 7 (64 bit), R 3.4.1 and RStudio 1.0.153
I think i found a temporary answer for my problem. I previously had problems related to the privilege in writing the library folder in R. Tried to work around by turning off anti-virus live update, change the security of the R folder, etc. I thought it was worked, since I did not find anymore issues on "unable to move temporary installation....". But when I restart my computer, the problem came again.
Since I am working in a university provided laptop, I need to wait until the IT grants me access as an admin. While waiting for it, I created a new library in C:/ (in my case, I named it as "R library local"). Downloaded all the package to that library
install.packages("plm", dependencies = TRUE, lib = "C:/R library local")
And load the package from the library
library("plm", lib="C:/R library local")
It works well :)
Dunno if I still need the admin access for the library in R folder or not.

Resources