如何使用 Devtools 从 Github 安装 RHadoop 包 rhdfs

How do I Install RHadoop package rhdfs from Github using Devtools

如何使用 Devtools

从 Github 安装 Rhadoop

我基本上想从 https://github.com/RevolutionAnalytics/rhdfs

安装 rhdfs

但这不起作用

我尝试了以下方法

> install_github("https://github.com/RevolutionAnalytics/rhdfs")
Error in username %||% getOption("github.user") %||% stop("Unknown username.") : 
  Unknown username.
> install_git("https://github.com/RevolutionAnalytics/rhdfs")
Downloading git repo https://github.com/RevolutionAnalytics/rhdfs
Error: Does not appear to be an R package (no DESCRIPTION)
> install_git("https://github.com/RevolutionAnalytics/rhdfs/pkg")
Downloading git repo https://github.com/RevolutionAnalytics/rhdfs/pkg
Error in git2r::clone(x$url, bundle, progress = FALSE) : 
  Error in 'git2r_clone': Unexpected HTTP status code: 404

> url="https://github.com/RevolutionAnalytics/rhdfs/blob/master/pkg/R/hdfs.r"
> source_url(url = url)
SHA-1 hash of file is 106c6441dcc7e8e4ee21a6dd3725ca21c4103ce7
Error in source(temp_file, ...) : 
  /tmp/RtmplCSWzE/file16aa477002e1:4:1: unexpected '<'
3: 
4: <

这里有两个问题:

  1. RHadoop 的安装说明不太清楚。 但是,您仍然需要为 RHadoop 进行 rtfm(例如 https://github.com/RevolutionAnalytics/RHadoop/wiki/user%3Ermr%3EHome 用于设置环境变量,例如 HADOOP_CMD.

  2. 您对 install_github() 使用了错误的语法。尝试:

    devtools::install_github("RevolutionAnalytics/rhdfs", subdir = "pkg")
    

感谢以上@pascal

您可以从这里下载并安装 Rhadoop 包

https://github.com/RevolutionAnalytics/RHadoop/wiki/Downloads

rhdfs 有一些先决条件

https://github.com/RevolutionAnalytics/RHadoop/wiki/user%3Erhdfs%3EHome

  Prerequisites

    This package has a dependency on rJava
    Access to HDFS via this R package is dependent upon the HADOOP_CMD environment variable. HADOOP_CMD points to the full path for the hadoop binary. If this variable is not properly set, the package will fail when the init() function is invoked
    Example:

HADOOP_CMD=/usr/bin/hadoop