r - I think TM package cannot plot 2 letter word like bg or go or su -



r - I think TM package cannot plot 2 letter word like bg or go or su -

i trying text mining .. below code surprising tm cannot show 2 letter word bg

see sample output of 2 variation

[[1]] <> g hargrov hargrg phone inquir led complaint custom respons sts got alarm pump alarm ts per dop patient bg treat manual inject expl alarm possibl caus check alarm hx found cust way hospit phone call drop cust unhappi line state explain alarm explain alarm cust phone call disconnect sts auto drive pump backseat continu troubleshoot cust pump without battrey time custom outcom pertain complaint phone call disconect complet cust sts auto drive way hospit sts go work go admitt phone call disconnect ship noth homecoming noth

--- 3 letter word shown up

> dtm_list_harms<-documenttermmatrix(tdm[1],list(dictionary = c("led"))) > inspect(dtm_list_harms) <<documenttermmatrix (documents: 1, terms: 1)>> non-/sparse entries: 1/0 sparsity : 0% maximal term length: 3 weighting : term frequency (tf) terms docs led 1 1

-- 2 letter word not ..

> dtm_list_harms<-documenttermmatrix(tdm[1],list(dictionary = c("bg"))) > inspect(dtm_list_harms) <<documenttermmatrix (documents: 1, terms: 1)>> non-/sparse entries: 0/1 sparsity : 100% maximal term length: 2 weighting : term frequency (tf) terms docs bg 1 0

a bug in tm bundle or there technique dont know? in advance

try next (please create examples reproducible info on):

dtm_list_harms<-documenttermmatrix(tdm[1],list(dictionary = c("led"), ,control=list(wordlengths=c(1,inf)))

this isn't perfect because didn't have much work with.

r tm

Comments

Popular posts from this blog

javascript - I need to update the text of a paragraph by inline edit -

javascript - THREE.js reposition vertices for RingGeometry -

assembly - What is the addressing mode for ld, add, and rjmp instructions? -