Examples for 'tm::inspect'


Inspect Objects

Aliases: inspect inspect.PCorpus inspect.TermDocumentMatrix inspect.TextDocument inspect.VCorpus

Keywords:

### ** Examples

data("crude")
inspect(crude[1:3])
<<VCorpus>>
Metadata:  corpus specific: 0, document level (indexed): 0
Content:  documents: 3

$`reut-00001.xml`
<<PlainTextDocument>>
Metadata:  15
Content:  chars: 527

$`reut-00002.xml`
<<PlainTextDocument>>
Metadata:  15
Content:  chars: 2634

$`reut-00004.xml`
<<PlainTextDocument>>
Metadata:  15
Content:  chars: 330
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
tdm <- TermDocumentMatrix(crude)[1:10, 1:10]
inspect(tdm)
<<TermDocumentMatrix (terms: 10, documents: 10)>>
Non-/sparse entries: 9/91
Sparsity           : 91%
Maximal term length: 10
Weighting          : term frequency (tf)
Sample             :
            Docs
Terms        127 144 191 194 211 236 237 242 246 248
  ...          0   0   0   0   0   0   0   0   0   1
  "(it)        0   0   0   0   0   0   1   0   0   0
  "demand      0   1   0   0   0   0   0   0   0   0
  "expansion   0   0   0   0   0   0   0   0   0   0
  "for         0   0   0   0   0   0   1   0   0   0
  "growth      0   0   0   0   0   0   1   0   0   0
  "if          0   0   0   0   0   1   0   0   0   0
  "is          0   0   0   0   0   0   0   0   0   1
  "may         0   0   0   0   0   0   0   0   0   1
  "none        0   0   0   0   0   1   0   0   0   0

[Package tm version 0.7-15 Index]