2013-02-27 102 views
0

我是新来的R,Rhipe和Hadoop想从文件,其内容是读取数据,如何从文本文件中读取数据在HDFS中使用Rhipe,R?

<Author>fallriverma 
<Content>Quality hotel at great price Very clean. 
<Date>Nov 25, 2008 
<Rating>5 5 5 5 5 5 5 5 
<Aspects> 
1 8826(grat):1  
3 3(clean):1 19(price):1 187(quality):1 
0 
0 
0 
3 0(staff):1 12(friendly):1 14(helpful):1 
3 6(breakfast):1 46(free):1 333(selection):1  
0 

<Author>yondaime1845 
<Content>Its the best of the best for a reason One of the more affordable and better hotels in the city of seattle. 
<Date>Jan 2, 2008 
<Rating>5 5 5 5 5 5 5 5 
<Aspects> 
4 41(city):1 374(reason):1 762(seattle):1 1062(affordable):1 
0 
0 
4 1(location):1 66(park):1 143(cheap):1 186(convenient):1 
0 
0 
4 5(time):1 9(service):1 12(friendly):1 608(employee):1 
0 

我想从读起来像8826的作者和方面价值“8826(qrat):1”,并想显示他们使用Hadoop,rhipe和R逐列米

的希望您的建议提前

+0

我试过这个,但不允许我多一个分隔符“ny <-read.table(pipe(”hadoop dfs -cat'new1'“),sep =”>:“,header = TRUE)” – 2013-02-27 11:56:12

+0

new1是我的文件,其中包含数据,如后所述 – 2013-02-28 04:47:14

回答

0

rhls("/user/notroot/input/")

谢谢你,给你HDFS的完整路径位置 - 它会工作