> inspect (TermDocumentMatrix (txt, list (dictionary = c ("car"))))
<<TermDocumentMatrix (terms: 1, documents: 5)>>
Non-/sparse entries: 4/1
Sparsity           : 20%
Maximal term length: 3
Weighting          : term frequency (tf)
Sample             :
     Docs
Terms 1 2 3 4 5
  car 2 1 1 0 1
> inspect (TermDocumentMatrix (txt, list (dictionary = c ("car", "artifici"))))
<<TermDocumentMatrix (terms: 2, documents: 5)>>
Non-/sparse entries: 7/3
Sparsity           : 30%
Maximal term length: 8
Weighting          : term frequency (tf)
Sample             :
          Docs
Terms      1 2 3 4 5
  artifici 2 0 1 0 2
  car      2 1 1 0 1
> txt_tfidf <- TermDocumnntMatrix (txt, control = list (weighting = weightTfIdf))
Error in TermDocumnntMatrix(txt, control = list(weighting = weightTfIdf)) : 
  could not find function "TermDocumnntMatrix"
> txt_tfidf <- TermDocumentMatrix (txt, control = list (weighting = weightTfIdf))
> txt_tfidf
<<TermDocumentMatrix (terms: 395, documents: 5)>>
Non-/sparse entries: 498/1477
Sparsity           : 75%
Maximal term length: 17
Weighting          : term frequency - inverse document frequency (normalized) (tf-idf)
> inspect (txt_tfidf)
<<TermDocumentMatrix (terms: 395, documents: 5)>>
Non-/sparse entries: 498/1477
Sparsity           : 75%
Maximal term length: 17
Weighting          : term frequency - inverse document frequency (normalized) (tf-idf)
Sample             :
            Docs
Terms                 1          2           3          4 5
  ’re        0.00000000 0.00000000 0.000000000 0.05277109 0
  agi        0.06730226 0.00000000 0.000000000 0.00000000 0
  away       0.00000000 0.00000000 0.000000000 0.05277109 0
  might      0.00000000 0.03389559 0.029817927 0.00000000 0
  narrow     0.05747513 0.00000000 0.009939309 0.00000000 0
  outperform 0.06730226 0.00000000 0.000000000 0.00000000 0
  program    0.00000000 0.00000000 0.052374318 0.00000000 0
  search     0.06730226 0.00000000 0.000000000 0.00000000 0
  system     0.00000000 0.05649265 0.019878618 0.00000000 0
  task       0.03204198 0.01259770 0.005541095 0.00000000 0
> 
