(R)"Text Mining"如何查看<<PlainTextDocument>>中的详细信息?
(R) "Text Mining" how to see the detail information in <<PlainTextDocument>>?
刚开始学习文本挖掘,跟着书,我用tm::inspect()看到数据"crude"中的第一个信息,但和书上的例子不一样,R showed me以下内容而不是书中所说的详细信息。
我想知道为什么会这样?我该如何纠正它?谢谢!
(对不起我糟糕的英语哈哈..)
我的代码:
library(tm)
data(crude)
inspect(crude[1])
summary(crude)
和输出:
> inspect(crude[1])
<<VCorpus>>
Metadata: corpus specific: 0, document level (indexed): 0
Content: documents: 1
$`reut-00001.xml`
<<PlainTextDocument>>
Metadata: 15
Content: chars: 527
> summary(crude)
Length Class Mode
127 2 PlainTextDocument list
144 2 PlainTextDocument list
191 2 PlainTextDocument list
194 2 PlainTextDocument list
211 2 PlainTextDocument list
236 2 PlainTextDocument list
237 2 PlainTextDocument list
难道是你忘了一对方括号?
library(tm)
data("crude")
inspect(crude[[1]])
对我来说,它打印出以下内容:
<<PlainTextDocument>>
Metadata: 15
Content: chars: 527
Diamond Shamrock Corp said that
effective today it had cut its contract prices for crude oil by
1.50 dlrs a barrel.
The reduction brings its posted price for West Texas
Intermediate to 16.00 dlrs a barrel, the copany said.
"The price reduction today was made in the light of falling
oil product prices and a weak crude oil market," a company
spokeswoman said.
Diamond is the latest in a line of U.S. oil companies that
have cut its contract, or posted, prices over the last two days
citing weak oil markets.
Reuter
刚开始学习文本挖掘,跟着书,我用tm::inspect()看到数据"crude"中的第一个信息,但和书上的例子不一样,R showed me以下内容而不是书中所说的详细信息。
我想知道为什么会这样?我该如何纠正它?谢谢! (对不起我糟糕的英语哈哈..)
我的代码:
library(tm)
data(crude)
inspect(crude[1])
summary(crude)
和输出:
> inspect(crude[1])
<<VCorpus>>
Metadata: corpus specific: 0, document level (indexed): 0
Content: documents: 1
$`reut-00001.xml`
<<PlainTextDocument>>
Metadata: 15
Content: chars: 527
> summary(crude)
Length Class Mode
127 2 PlainTextDocument list
144 2 PlainTextDocument list
191 2 PlainTextDocument list
194 2 PlainTextDocument list
211 2 PlainTextDocument list
236 2 PlainTextDocument list
237 2 PlainTextDocument list
难道是你忘了一对方括号?
library(tm)
data("crude")
inspect(crude[[1]])
对我来说,它打印出以下内容:
<<PlainTextDocument>>
Metadata: 15
Content: chars: 527
Diamond Shamrock Corp said that
effective today it had cut its contract prices for crude oil by
1.50 dlrs a barrel.
The reduction brings its posted price for West Texas
Intermediate to 16.00 dlrs a barrel, the copany said.
"The price reduction today was made in the light of falling
oil product prices and a weak crude oil market," a company
spokeswoman said.
Diamond is the latest in a line of U.S. oil companies that
have cut its contract, or posted, prices over the last two days
citing weak oil markets.
Reuter