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

时间:2015-07-15 08:09:02

标签: r github devtools rhadoop

如何使用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: <

2 个答案:

答案 0 :(得分:2)

这里有两个问题:

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

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

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

答案 1 :(得分:1)

由@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