Install R Packages from Github Downloading Master.Zip

Install R packages from github downloading master.zip

This answer is just a refined version of my comments. Essentially you can install packages using devtools by unzipping a local zipfile downloaded from github, and then running the install function


install("path/to/unzipped_pkg_zip_file")

The latest dev version of devtools contains an install_local utility function that makes it easy to work directly with local zip files.

Installing a package offline from GitHub

Let's assume that you have Rtools and devtools on the win machine.

Step 1: Download the source zip.

Step 2: Copy to the win machine and unzip the content there.

Step 3: Run the following code (adjust the path as necessary):

library(devtools)
source <- devtools:::source_pkg("E:/temp/data.table-master")
install(source)

library(data.table)
#loads 1.9.7

Rstudio unable to install 'psimetrica-R' package from Github

A github source repository is not an R package repository like CRAN -- so you cannot use install.packages().

Instead, use remotes::install_gihub() as in

if (!requireNamespace("remotes", quietly=TRUE)) install.packages("remotes")
remotes::install_github("stmueller/psimetrica-R")

This will install remotes if needed, and use it to install the desired package.

Or, at least, that would work in principle if psimetrica-R was a regular R source package. Here it fails because of its layout:

> remotes::install_github("stmueller/psimetrica-R")
Error: Failed to install 'unknown package' from GitHub:
cannot open URL 'https://api.github.com/repos/stmueller/psimetrica-R/contents/DESCRIPTION?ref=HEAD'
>

So you could fork the repo and make it proper package first. At least open source lets you do that.



Related Topics



Leave a reply



Submit