Error 404 installing R package from public github repro - r

I am trying to install the gaRdenbox package from github (https://github.com/KTMD-plant/gaRdenbox)
But when I run
install_github("KTMD-plant/gaRdenbox")
it returns
Error: Failed to install 'unknown package' from GitHub:
HTTP error 404.
Not Found
Did you spell the repo owner (KTMD-plant) and repo name (gaRdenbox) correctly?
-If spelling is correct, check that you have the required permissions to access the repo.
As far as I can see the repro is public. Do you have any idea what is the issue here?

This is a bug in package gaRdenbox as the file DESCRIPTION is 'missing' given that there is only a file Description.
You can test that by forking the package and altering the file by renaming it -- which I did in this fork in my repo. Now we can install as expected:
edd#rob:/tmp$ installGithub.r eddelbuettel/gaRdenbox
Using github PAT from envvar GITHUB_PAT
Downloading GitHub repo eddelbuettel/gaRdenbox#HEAD
✔ checking for file ‘/tmp/remotes12841a2d0cc36c/eddelbuettel-gaRdenbox-fd41a57/DESCRIPTION’ ...
─ preparing ‘gaRdenbox’:
✔ checking DESCRIPTION meta-information
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ building ‘gaRdenbox_0.0.1.0.tar.gz’
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
* installing *source* package ‘gaRdenbox’ ...
** using staged installation
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** 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 (gaRdenbox)
edd#rob:/tmp$
(where installGitHub.r is a simple wrapper for the command-line from my littler package). You can ignore the PAT message; I have one in my environment for other reasons.
I have filed a PR at the upstream repo.

Related

Cannot mannually install package in R

I am trying to install package using:
library(devtools)
install_github("s-conner/rmtl/rpackage")
However, I got error:
Error: Failed to install 'RMTL' from GitHub:
schannel: failed to receive handshake, SSL/TLS connection failed
Any advise, please?
It installs fine for me (on Linux). As the output shows, I also have a GITHUB_PAT but I do not think that should be required for a public repository.
$ installGithub.r s-conner/rmtl/rpackage
Using github PAT from envvar GITHUB_PAT
Downloading GitHub repo s-conner/rmtl#HEAD
── R CMD build ────────────────────────────────────────────────────────────────────────────
✔ checking for file ‘/tmp/remotes16a2746ead7197/s-conner-rmtl-c2fb188/rpackage/DESCRIPTION’ ...
─ preparing ‘rmtl’:
✔ checking DESCRIPTION meta-information ...
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
Omitted ‘LazyData’ from DESCRIPTION
─ building ‘rmtl_0.0.0.9000.tar.gz’
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
* installing *source* package ‘rmtl’ ...
** using staged installation
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** 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 (rmtl)
$
(where installGithub.r is a simple convenience wrapper for remotes::install_github from my littler CRAN package.)
So I guess you need to work out why the https handshake to GitHub fails for you. It would seem that GitHub serves the repository just fine.
you can also source the 3 functions in the package at the start of your code
devtools::source_url("https://raw.githubusercontent.com/s-conner/rmtl/master/rpackage/R/cif.R")
devtools::source_url("https://raw.githubusercontent.com/s-conner/rmtl/master/rpackage/R/rmtl.R")
devtools::source_url("https://raw.githubusercontent.com/s-conner/rmtl/master/rpackage/R/rmtl_mod.R")
You can also download the 3 r scripts files and source them
source("path/to/rmtl.R")

R install.package fails on data-raw file not found

I am building an R package, with some associated data. I have created a data-raw folder using usethis:: functions, put various txt fies there, and built out R code to generate the .rda/Rdata files. I have used the use_data() function to generate the .rda and Rdata files and these I can see in /data.
I can retrieve these objects using load_all().
I then build a source package, which generates a compressed-tar-ball.
Finally I attempt to install that tar-ball/package in another project and get:
devtools::install_local("/home/fred/Rprojects/evidently/evidently_0.0.2.1.tar.gz")
✓ checking for file ‘/tmp/Rtmp53yb8S/remotes2eaf7a4fc2cb/evidently/DESCRIPTION’ ...
─ preparing ‘evidently’:
✓ checking DESCRIPTION meta-information
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ building ‘evidently_0.0.2.1.tar.gz’
Installing package into ‘/home/rob/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
* installing *source* package ‘evidently’ ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** byte-compile and prepare package for lazy loading
Error : **'/tmp/Rtmp0PbObQ/R.INSTALL391126f5cc7c/evidently/data-raw/TPBULET-A.txt' does not exist.**
Error: unable to load R code in package ‘evidently’
Execution halted
ERROR: lazy loading failed for package ‘evidently’
* removing ‘/home/fred/R/x86_64-pc-linux-gnu-library/4.0/evidently’
* restoring previous ‘/home/rob/R/x86_64-pc-linux-gnu-library/4.0/evidently’
Error: Failed to install 'evidently' from local:
(converted from warning) installation of package ‘/tmp/Rtmp53yb8S/file2eaf5f6ca68c/evidently_0.0.2.1.tar.gz’ had non-zero exit status
>
But the file it says it is looking for is in data-raw in the package folder.
I am missing something obvious here. I would welcome suggestions on why the system is not seeing the txt file, and why it is therefore aborting the install.
This happens when you have a rogue link to the data-raw file, in a file you thought you had purged, and when it gets loaded as part of install-packages, it tries to find a file in data-raw/ that is not there in the package, because data-raw/ is not part of the package, just in the source code. So, search your files and find the forgotten bit of code. Hang head in shame.

R: unable to install gbm.auto package from Github

I'm trying to install the package gbm.auto via github, but the download does not seem to work. How can I solve this? I am working on a windows 10 Pro (R version 3.6.1, Rstudio version 1.2.5042). This is the error I get:
remotes::install_github("SimonDedman/gbm.auto")
Downloading GitHub repo SimonDedman/gbm.auto#master
√ checking for file 'C:\Users\Ststrubb\AppData\Local\Temp\RtmpOcwGGZ\remotes1d5c7c774f2a\SimonDedman-gbm.auto-96328bf/DESCRIPTION' ...
- preparing 'gbm.auto': (359ms)
√ checking DESCRIPTION meta-information ...
- checking for LF line-endings in source and make files and shell scripts
- checking for empty or unneeded directories
- looking to see if a 'data/datalist' file should be added
- building 'gbm.auto_1.2.4.tar.gz'
Installing package into ‘C:/Users/Ststrubb/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
* installing *source* package 'gbm.auto' ...
** using staged installation
** R
Error in parse(outFile) :
C:/Users/Ststrubb/AppData/Local/Temp/RtmpALsbRt/R.INSTALL7320575e5a03/gbm.auto/R/gbm.valuemap.R:462:0: unexpected end of input
460: beep(8)} # notify user & close function
461:
^
ERROR: unable to collate and parse R files for package 'gbm.auto'
* removing 'C:/Users/***/Documents/R/win-library/3.6/gbm.auto'
Error: Failed to install 'gbm.auto' from GitHub:
(converted from warning) installation of package ‘C:/Users/***/AppData/Local/Temp/RtmpOcwGGZ/file1d5c40b85311/gbm.auto_1.2.4.tar.gz’ had non-zero exit status
I get the same error when I used
githubinstall or remotes::install_github.

Package Installation From GitHub Error - Possibly File Path

I am currently trying to install some packages off of GitHub, but I keep on getting this fatal error. I think it has something to do with the file destination, but I am unsure. Any advice would be appreciated!
> devtools::install_github("hrbrmstr/albersusa")
Downloading GitHub repo hrbrmstr/albersusa#master
√ checking for file 'C:\Users\FirstName Surname\AppData\Local\Temp\RtmpeqCuBA\remotes51a46de62be1\hrbrmstr-albersusa-5b933bf/DESCRIPTION' (489ms)
- preparing 'albersusa':
√ checking DESCRIPTION meta-information ...
- checking for LF line-endings in source and make files and shell scripts
- checking for empty or unneeded directories
- building 'albersusa_0.3.1.tar.gz'
Installing package into ‘C:/Users/FirstName Surname/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
* installing *source* package 'albersusa' ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Fatal error: cannot open file 'C:\Users\FirstName': No such file or directory
ERROR: lazy loading failed for package 'albersusa'
* removing 'C:/Users/FirstName Surname/Documents/R/win-library/3.6/albersusa'
Error in i.p(...) :
(converted from warning) installation of package ‘C:/Users/FirstName Surname/AppData/Local/Temp/RtmpeqCuBA/file51a45f6e3a8b/albersusa_0.3.1.tar.gz’ had non-zero exit status
The packages should be installed into ‘C:/Users/FirstName Surname/Documents/R/win-library/3.6’ as it says it is doing, however it gives the fatal error when it encounters: 'C:\Users\FirstName' which is different.
Edit: Windows 10, R-3.6.0, RStudio
Thanks!
Upgrading the r package to 4.0.1 version solved this issue

No vignettes found by browseVignettes where they actually are there

I have a package on a github repository with 2 vignettes in the vignettes/ directory.
I tried to download if with devtools package like this
> if (!require(devtools)) {
+ install.packages("devtools")
+ require(devtools)
+ }
> install_github("MarcinKosinski/RTCGA", build_vignettes=TRUE)
Downloading github repo MarcinKosinski/RTCGA#master
Installing RTCGA
"D:/R-32~1.2/bin/x64/R" --no-site-file --no-environ --no-save --no-restore CMD INSTALL \
"C:/Users/Marcin/AppData/Local/Temp/Rtmpg1Kbfy/devtools3cf47f1f6731/MarcinKosinski-RTCGA-0d91d7c" \
--library="C:/Users/Marcin/Documents/R/win-library/3.2" --install-tests
* installing *source* package 'RTCGA' ...
** R
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (RTCGA)
Reloading installed RTCGA
Welcome to the RTCGA (version: 0.99.6).
but when I try to browse Vignettes it appears they were not build.
> library(RTCGA)
> browseVignettes("RTCGA")
No vignettes found by browseVignettes("RTCGA")
I've seen some old issue where people suggested to use build_vignettes=TRUE, but as you see it didn't help OR to add move Vignettes to remove inst/doc/ directory from .Rbuildignore file. But this must be and old issue, because I haven't seen such directory in a binary source after installation of the package.
I've also seen this answer on a similar question, but when I built source and then install package from a source it appears to have the same issue: No vignettes found by browseVignettes("RTCGA").
Any idea on how to make this work?
EDIT
According to Martin's answer
I've addedthis fragment of code to vignettes' YAML
vignette: >
%\VignetteIndexEntry{Integrating TCGA Data - RTCGA Tutorial}
%\VignetteEngine{knitr::rmarkdown}
I've edited YAML of 2 of my vignettes
I've added code to the beggining of YAML - this file
Just in case I once added new information to the end of YAML - this file
but still there appears there are no vignettes available after installation from github
> devtools::install_github("MarcinKosinski/RTCGA")
Downloading github repo MarcinKosinski/RTCGA#master
Installing RTCGA
'/usr/lib/R/bin/R' --vanilla CMD INSTALL \
'/tmp/Rtmpk34Zbr/devtools531845716f54/MarcinKosinski-RTCGA-5571117' \
--library='/home/mkosinski/R/x86_64-pc-linux-gnu-library/3.2' --install-tests
* installing *source* package ‘RTCGA’ ...
** R
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (RTCGA)
> library(RTCGA)
Welcome to the RTCGA (version: 0.99.6).
> browseVignettes("RTCGA")
No vignettes found by browseVignettes("RTCGA")
EDIT 2
Of course I've forgoten to add parameter buildVignettes = TRUE but after this it looks like vignettes are seen but there is some problem with their compilation during build:
devtools::install_github("MarcinKosinski/RTCGA", build_vignettes=TRUE)
Downloading github repo MarcinKosinski/RTCGA#master
Installing RTCGA
'/usr/lib/R/bin/R' --vanilla CMD build \
'/tmp/RtmpA7il1Q/devtools5fc871b48f57/MarcinKosinski-RTCGA-e47bdf6' \
--no-resave-data --no-manual
* checking for file ‘/tmp/RtmpA7il1Q/devtools5fc871b48f57/MarcinKosinski-RTCGA-e47bdf6/DESCRIPTION’ ... OK
* preparing ‘RTCGA’:
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
* creating vignettes ... OK
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
Removed empty directory ‘RTCGA/ghPage’
Removed empty directory ‘RTCGA/inst’
* building ‘RTCGA_0.99.6.tar.gz’
'/usr/lib/R/bin/R' --vanilla CMD INSTALL \
'/tmp/RtmpA7il1Q/RTCGA_0.99.6.tar.gz' \
--library='/home/mkosinski/R/x86_64-pc-linux-gnu-library/3.2' \
--install-tests
* installing *source* package ‘RTCGA’ ...
** R
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
Warning in file(con, "w") :
cannot open file '/home/mkosinski/R/x86_64-pc-linux-gnu-library/3.2/RTCGA/doc/index.html': No such file or directory
Error in file(con, "w") : cannot open the connection
ERROR: installing vignettes failed
* removing ‘/home/mkosinski/R/x86_64-pc-linux-gnu-library/3.2/RTCGA’
* restoring previous ‘/home/mkosinski/R/x86_64-pc-linux-gnu-library/3.2/RTCGA’
Error: Command failed (1)
From Writing R Extensions, section 1.4.2, your vignettes need to have a line
%\VignetteEngine{knitr::knitr}
in them; a common paradigm is to add the following to the yaml at the top of the vignette
vignette: >
%\VignetteIndexEntry{Integrating TCGA Data}
%\VignetteEngine{knitr::rmarkdown}
VignetteIndexEntry provides a convenient title for R's help system. Remember the BiocStyle package for creating vignettes with a consistent look.
I only could solve this, using:
devtools::build_vignettes()
Of course, then uploading the new files by git

Resources