简体   繁体   中英

R package doesn't install from github

I am using RStudio with R (Version 4.0.2) and I am trying to install this climate package from github: https://github.com/SantanderMetGroup/climate4R when I type: install_github("SantanderMetGroup/climate4R")

I get this error:
Error: Failed to install 'unknown package' from GitHub:
  HTTP error 404.
  Not Found

  Did you spell the repo owner (`SantanderMetGroup`) and repo name (`climate4R`) correctly?
  - If spelling is correct, check that you have the required permissions to access the repo.

I also downloaded the zipped package and tried to manually install the package within rstudio and got this error:

Installing package into ‘C:/Users/...../Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
Warning in install.packages :
  cannot open compressed file 'climate4R-master/DESCRIPTION', probable reason 'No such file or directory'
Error in install.packages : cannot open the connection

Why is it not installing? I have downloaded packages from github before with no problems.

UPDATED HERE: I had already tried what is suggested below, but it also didn't work. I wanted to check first if I had missed something and it was possible to download the package all at once. When I input this:

library(devtools)
install_github(c("SantanderMetGroup/loadeR.java",
                   "SantanderMetGroup/climate4R.UDG",
                   "SantanderMetGroup/loadeR",
                   "SantanderMetGroup/transformeR",
                   "SantanderMetGroup/visualizeR",
                   "SantanderMetGroup/downscaleR"))

I get the following error:

Downloading GitHub repo SantanderMetGroup/loadeR.java@HEAD
√  checking for file 'C:\Users\...\AppData\Local\Temp\RtmpCAqAGF\remotes39b87d2f4f9\SantanderMetGroup-loadeR.java-88da23e/DESCRIPTION' ...
-  preparing 'loadeR.java':
√  checking DESCRIPTION meta-information ... 
-  checking for LF line-endings in source and make files and shell scripts
-  checking for empty or unneeded directories
-  building 'loadeR.java_1.1.1.tar.gz'
   

Installing package into ‘C:/Users/.../Documents/R/win-library/4.0’ (as ‘lib’ is unspecified)
* installing *source* package 'loadeR.java' ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading Error: package or namespace load failed for 'rJava':  .onLoad failed in loadNamespace() for 'rJava', details:   call: fun(libname, pkgname)   error: JAVA_HOME cannot be determined from the Registry Error: package 'rJava' could not be loaded Execution halted ERROR: lazy loading failed for package 'loadeR.java'
* removing 'C:/Users/.../Documents/R/win-library/4.0/loadeR.java' Error: Failed to install 'loadeR.java' from GitHub:   (converted from warning) installation of package ‘C:/Users/.../AppData/Local/Temp/RtmpCAqAGF/file39b86ae96acb/loadeR.java_1.1.1.tar.gz’ had non-zero exit status

As already pointed out, the GitHub Repo is not an R package by itself.

Here from their GitHub Readme how to install their collection of packages that form the climate4R toolset.

library(devtools)
install_github(c("SantanderMetGroup/loadeR.java",
             "SantanderMetGroup/climate4R.UDG",
             "SantanderMetGroup/loadeR",
             "SantanderMetGroup/transformeR",
             "SantanderMetGroup/visualizeR",
             "SantanderMetGroup/downscaleR"))

In order to install this package, I had to install this:JDK 13 https://www.oracle.com/java/technologies/javase-jdk13-downloads.html

This allowed each of the packages to be installed correctly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM