build and install r package from github repository under Windows - r

I would like to build an R package from a github repository for an older version of R:
https://github.com/suiji/Arborist/
The R package is actually Rborist, so not sure whether to clone the whole repo mentioned above?
I installed Rtools after miserably failing to run:
library(devtools)
install_github("https://github.com/suiji/Arborist/tree/master/Rborist/src")
or:
library(devtools)
install_github("suiji/Arborist")
What do I have to do to build this package please?

Related

Tidyverse not installing

I'm having a bit of a pickle right now with the package tidyverse, that I need for an assignment on layering maps. I tried installing the package using install.packages("tidyverse") and install.packages ("tidyverse", dependencies = TRUE) but when I ran library(tidyverse) it wasn't installed. I searched online and found that I had an older version of RStudio IDE so I uploaded the latest version (1.3.1056).
After installing the newest version, I reinstalled the package but R tells me the following:
"Rtools is required to build R packages but is not currently
installed".
So, I did it, but the R tells me Rtools package is not available for R version 3.5.3.
What can I do to use tidyverse?
It could be a permissions issue, try setting the directory for where you install R packages/libraries on your computer using libpaths. I have to do this on my work laptop because the university has it set up to store things like this in a tempporary directory on the remote server which isn't desirable.
.libPaths("C:/R")
.libPaths()

R - Installing package with remotes::install_github ask for higher version of the dependencies which BiocManager::install() can not find

I need to install few packages that should be installed with remotes::install_github() like
"acidgenomics/basejump" or "satijalab/seurat".
During the installation, it need to upgrade few other packages version. The BiocManager::install program cannot find those versions and I had to install those dependencies packages version with:
R CMD INSTALL IRanges_2.20.2.tar.gz
Then other packages, that use the same packages stop working. like DESeq2,
I get the error:
Error: package or namespace load failed for ‘DESeq2’:
objects ‘rowSums’, ‘colSums’, ‘rowMeans’, ‘colMeans’ are not exported by 'namespace:S4Vectors'
I found few answers that say it happen (like url)
remotes::install_github() isn't picking up the correct Bioconductor
devel repos, whereas installing with BiocManager::install() does work
as expected.
we have the R 3.6.0 installed as a module and a lot of users uses the same R version. I need all packages to work for everyone.
How can I make all variety packages versions to work?
Finally, I install new version of R 3.6.3 with Bioconductor 3.10 and all the packages install right.

Conda: install R package from github [duplicate]

any one can suggest how to use conda in Linux to install R package from github?
Thanks!
According to this: https://github.com/conda/conda/issues/6674
You can create your own conda skeleton of a github derived R-package much as you would for a CRAN package.
Try doing
conda skeleton cran <github_url>
conda build --R=<my_r_version> r-<lower-case-package-name>
Then upload the built conda package to your own anaconda repository.
This will fail if any of the dependencies of the package are absent from the anaconda repos that you have access to. So you might have to conda-build a few other packages along the way.
Alternatively, you could install it directly with devtools::install_github(github_url, dependencies = FALSE). If you do go down this route, please ensure that any conda-available dependencies for the github package are already installed.
If you don't use dependencies = FALSE R will install.packages a bunch of updates. (As far as I can tell) When you install.packages a pre-installed package some_package in a conda env (eg, to update it) and then check conda list <some_package> on your current env, it will show the version that was installed by conda, rather than the updated version.
Edited build command, following #rpanai s suggestion

install R package from github using "conda"

any one can suggest how to use conda in Linux to install R package from github?
Thanks!
According to this: https://github.com/conda/conda/issues/6674
You can create your own conda skeleton of a github derived R-package much as you would for a CRAN package.
Try doing
conda skeleton cran <github_url>
conda build --R=<my_r_version> r-<lower-case-package-name>
Then upload the built conda package to your own anaconda repository.
This will fail if any of the dependencies of the package are absent from the anaconda repos that you have access to. So you might have to conda-build a few other packages along the way.
Alternatively, you could install it directly with devtools::install_github(github_url, dependencies = FALSE). If you do go down this route, please ensure that any conda-available dependencies for the github package are already installed.
If you don't use dependencies = FALSE R will install.packages a bunch of updates. (As far as I can tell) When you install.packages a pre-installed package some_package in a conda env (eg, to update it) and then check conda list <some_package> on your current env, it will show the version that was installed by conda, rather than the updated version.
Edited build command, following #rpanai s suggestion

Installing Packages in R - mgarch

im trying to install mgarch package from Github. I downloaded the zip file: mgarch_0.00-1.tar.gz
I tried this procedure:
install.packages('package.zip', lib='destination_directory',repos = NULL)
as said here Manually Downloading and Installing Packages in R
But didnt work
Another procedure was: How to install development version of R packages github repository
As suggested at this link i had to install devtools from Hadley.
install.packages("devtools")
library(devtools)
dev_mode(on=T)
install_github("ggplot2")
I did, and nothing happened.
As a begginer im really lost. Just want something to clear my way, because i need to run an BEKK GARCH Model.
try this
library(devtools)
install_github("vst/mgarch")
library(mgarch)
installs this package https://github.com/vst/mgarch
is that the one you want?
the syntax for install_github is (usually) install_github("username/repository") this is rather poorly documented in the ?install_github documentation

Resources