how can I install to local dir using install_github
1
0
Entering edit mode
AKSR ▴ 20
@aksr-5026
Last seen 4.4 years ago

I am trying to an install R package for LTRpred, not available on CRAN, but only on GitHub, as follows:

library(devtools)
devtools::install_github("HajkD/LTRpred", args = c('--library="/home/aksr/software_downloads/R"'))

After some time, and hundreds of lines of STDOUT, that appeared like several updates / installs (of dependencies) were happening, it ended with this error message:

Installing package into ‘/home/aksr/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
ERROR: dependency ‘ggbio’ is not available for package ‘LTRpred’
* removing ‘/home/aksr/R/x86_64-pc-linux-gnu-library/3.6/LTRpred’
Error: Failed to install 'LTRpred' from GitHub:
  (converted from warning) installation of package ‘/tmp/RtmphWCa63/file76071968d246/LTRpred_1.1.0.tar.gz’ had non-zero exit status

Another syntax variant also failed, as follows:

 devtools::install_github("HajkD/LTRpred", args = '-l "/home/aksr/software_downloads/R"')
Downloading GitHub repo HajkD/LTRpred@master
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

1: All                                  
2: CRAN packages only                   
3: None                                 
4: R.methodsS3 (1.8.0  -> 1.8.1 ) [CRAN]
5: R.oo        (1.23.0 -> 1.24.0) [CRAN]

# Option 3 chosen

Enter one or more numbers, or an empty line to skip updates:3
✔  checking for file ‘/tmp/Rtmpiub65q/remotesc5e63a461ae/HajkD-LTRpred-71a4a38/DESCRIPTION’ (1s)
─  preparing ‘LTRpred’:
✔  checking DESCRIPTION meta-information ...
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘LTRpred_1.1.0.tar.gz’

Installing package into ‘/home/aksr/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
ERROR: dependency ‘ggbio’ is not available for package ‘LTRpred’
* removing ‘/home/aksr/R/x86_64-pc-linux-gnu-library/3.6/LTRpred’
Error: Failed to install 'LTRpred' from GitHub:
  (converted from warning) installation of package ‘/tmp/Rtmpiub65q/filec5e19e6e138/LTRpred_1.1.0.tar.gz’ had non-zero exit status
Error in validate_signal_args(msg, type, call, .subclass) : 
  unused arguments (call, .subclass)

Have my installation attempts failed, because of lack of root privileges on a multi-user HPCC, or because some (7 packages) dependencies are not available for this version of R version 3.6.3 (2020-02-29) -- "Holding the Windsock" , or both?

BTW, the syntax variants I've tried (shown above, as well as NOT shown above) are all from this stackoverflow post.

For CRAN packages, executing install.packages('package', lib="/my/chosen/local/path") is so simple. Isn't there an equivalent for install_github or some variant thereof? I hope this is a correct forum to seek help for my problem, and to get a successful install ASAP. Thanks, in advance!

> sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] devtools_2.3.0 usethis_1.6.1 

loaded via a namespace (and not attached):
 [1] magrittr_1.5      pkgload_1.1.0     R6_2.4.1          rlang_0.4.7      
 [5] fansi_0.4.1       tools_3.6.3       pkgbuild_1.1.0    sessioninfo_1.1.1
 [9] cli_2.0.2         withr_2.2.0       ellipsis_0.3.1    remotes_2.2.0    
[13] assertthat_0.2.1  digest_0.6.25     rprojroot_1.3-2   crayon_1.3.4     
[17] processx_3.4.3    callr_3.4.3       fs_1.5.0          ps_1.3.4         
[21] curl_4.3          testthat_2.3.2    memoise_1.1.0     glue_1.4.1       
[25] compiler_3.6.3    desc_1.2.0        backports_1.1.9   prettyunits_1.1.1
install_github local dir • 4.2k views
ADD COMMENT
4
Entering edit mode
@james-w-macdonald-5106
Last seen 16 hours ago
United States

This question has nothing to do with any Bioconductor packages, so it's completely off topic. HOWEVA, since we're all helpful and stuff, and since BiocManager is a Bioconductor package even though it's on CRAN, and since there's no reason that I can come up with to install any packages using anything else, like ever, here's an example. Two lines, bing bang boom.

> library(BiocManager)
Bioconductor version 3.11 (BiocManager 1.30.10), ?BiocManager::install for help
> install("HajkD/LTRpred")
Bioconductor version 3.11 (BiocManager 1.30.10), R 4.0.0 (2020-04-24)
Installing github package(s) 'HajkD/LTRpred'
Downloading GitHub repo HajkD/LTRpred@HEAD
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

 1: All                                  
 2: CRAN packages only                   
 3: None                                 
 4: R.methodsS3 (1.8.0  -> 1.8.1 ) [CRAN]
 5: dplyr       (1.0.1  -> 1.0.2 ) [CRAN]
 6: ps          (1.3.3  -> 1.3.4 ) [CRAN]
 7: backports   (1.1.8  -> 1.1.9 ) [CRAN]
 8: Hmisc       (4.4-0  -> 4.4-1 ) [CRAN]
 9: R.oo        (1.23.0 -> 1.24.0) [CRAN]
10: ape         (5.4    -> 5.4-1 ) [CRAN]

Enter one or more numbers, or an empty line to skip updates:

## NOTE HERE THAT I SIMPLY HIT ENTER BECAUSE I DON'T CARE TO UPDATE THOSE PACKAGES

Installing 4 packages: philentropy, ggsci, BSDA, biomartr
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/philentropy_0.4.0.zip'
Content type 'application/zip' length 1012340 bytes (988 KB)
downloaded 988 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/ggsci_2.9.zip'
Content type 'application/zip' length 2978733 bytes (2.8 MB)
downloaded 2.8 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/BSDA_1.2.0.zip'
Content type 'application/zip' length 891112 bytes (870 KB)
downloaded 870 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/biomartr_0.9.2.zip'
Content type 'application/zip' length 615371 bytes (600 KB)
downloaded 600 KB

package 'philentropy' successfully unpacked and MD5 sums checked
package 'ggsci' successfully unpacked and MD5 sums checked
package 'BSDA' successfully unpacked and MD5 sums checked
package 'biomartr' successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\Public\Documents\Wondershare\CreatorTemp\RtmpWowqpJ\downloaded_packages
v  checking for file 'C:\Users\Public\Documents\Wondershare\CreatorTemp\RtmpWowqpJ\remotes387cc004925\HajkD-LTRpred-71a4a38/DESCRIPTION' (1.9s)
-  preparing 'LTRpred': (1.7s)
v  checking DESCRIPTION meta-information
-  checking for LF line-endings in source and make files and shell scripts (2.2s)
-  checking for empty or unneeded directories
-  building 'LTRpred_1.1.0.tar.gz'

* installing *source* package 'LTRpred' ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package 'LTRpred'
    finding HTML links ... done
 < remove boring HTML stuff>
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
*** arch - i386
*** arch - x64
** testing if installed package can be loaded from final location
*** arch - i386
*** arch - x64
** testing if installed package keeps a record of temporary installation path
* DONE (LTRpred)

ADD COMMENT
1
Entering edit mode

Oh, and I don't understand the part about installing to a local dir? That's not your problem, regardless, and you can set that using .libPaths anyway, and if you don't have a local library dir, BiocManager is gonna ask you if you want to set one up and will do it for you. So I would do it one of the regular ways rather than trying to get install_github to do your bidding.

ADD REPLY
3
Entering edit mode

You're on a roll today James

ADD REPLY
0
Entering edit mode

My sincere apologies for mis-posting here. But thank you SO VERY MUCH for your help. These 2 lines worked for my install, I think, though with order of magnitude (~ 3.2K lines) more content in my STDOUT. It ended with

** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (LTRpred)
Installation path not writeable, unable to update packages: BiocManager,
  BiocVersion, MASS, mgcv, nlme, survival
Old packages: 'bit', 'bit64', 'dbplyr', 'devtools', 'DT', 'GenomicFeatures',
  'htmltools', 'knitr', 'later', 'promises', 'R.methodsS3', 'R.oo',
  'RcppArmadillo', 'rmarkdown', 'roxygen2', 'rversions', 'tinytex', 'xfun'
Update all/some/none? [a/s/n]: n
> library(LTRpred)

My concern is with the part that reads - Installation path not writeable

However, loading the package does not return an error

> library(LTRpred)

And I can see the help menu using

> ?LTRpred

I still need to install a couple of non-R dependencies, and then I'l run a small and quick test.

Once again, thanks a TON! :) And sorry for any trouble....

ADD REPLY
1
Entering edit mode

If you are a non-privileged user on Linux and you are using a system-wide install of R, then the library dir for the packages that come with R will be a directory in which you have no write privileges. So you won't be able to update things like MASS or mgcv or nlme or survival, because you don't have the privileges to do so. Which is what that note is telling you.

ADD REPLY

Login before adding your answer.

Traffic: 718 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6