Hi! I want to add install an R package named “textnets” which is available at GitHub - cbail/textnets: R package to perform automated text analysis using network techniques in Binder. Can somebody please tell me how to go about it?
I tried adding “apt.txt” file but it did not work.
Did you try adding the lines listed under Getting Started in your install.R
document? These would be the lines to add:
install.packages("devtools")
library(devtools)
install_github("cbail/textnets")
See about install.R
at:
Update: I tried that myself and it worked.
I am getting this error:
Installing package into ‘/srv/rlibs’
(as ‘lib’ is unspecified)
* installing *source* package ‘textnets’ ...
** using staged installation
** R
** data
** byte-compile and prepare package for lazy loading
Error: package or namespace load failed for ‘dplyr’:
(converted from warning) replacing previous import ‘vctrs::data_frame’ by ‘tibble::data_frame’ when loading ‘dplyr’
Error: package ‘dplyr’ could not be loaded
Execution halted
ERROR: lazy loading failed for package ‘textnets’
* removing ‘/srv/rlibs/textnets’
Error: Failed to install 'textnets' from GitHub:
(converted from warning) installation of package ‘/tmp/Rtmpe83mn8/file6383c2684/textnets_0.1.1.tar.gz’ had non-zero exit status
Execution halted
Removing intermediate container bee349834fc0
The command '/bin/sh -c if [ ! -f /tmp/.preassembled ]; then Rscript install.R; fi' returned a non-zero code: 1
I already tried few times what you suggested but I always got an error. I also tried install.Github.r user/package
in install.R file
but still got an error.
It worked at last! I used the following code in my install.R
file
install.packages("githubinstall")
library(githubinstall)
githubinstall("textnets")
1 Like
I suspect that error about Error: package or namespace load failed for ‘dplyr’:
was just trying to say it needed dplyr. Had you installed that already? My install.R inherited Tidyverse installation and so I assume that is why I didn’t encounter that in the build?
I did see stuff about special versions when I ran the library()
step to bring textnets
into the session.
If you didn’t change anything else, maybe that githubinstall
package does better getting related dependencies. Either way, thanks for posting the lines that worked. it is good to know about a related, slightly different way to install Github-based packages.
I did not change anything in my install.R
file which showed an error earlier but worked fine with githubinstall
.
1 Like