## Package version: 2.1.2
## Parallel computing: 2 of 2 threads used.
## See https://quanteda.io for tutorials and examples.
## 
## Attaching package: 'quanteda'
## The following object is masked from 'package:utils':
## 
##     View
## Loading required package: usethis
## 
## Attaching package: 'quanteda.textmodels'
## The following object is masked from 'package:quanteda':
## 
##     data_dfm_lbgexample
## 
## Attaching package: 'seededlda'
## The following object is masked from 'package:stats':
## 
##     terms
## 
## Attaching package: 'rsconnect'
## The following object is masked from 'package:devtools':
## 
##     lint
## 
## Attaching package: 'packrat'
## The following objects are masked from 'package:devtools':
## 
##     install, install_local

R Markdown

#create corpus

## readtext object consisting of 30 documents and 1 docvar.
## # Description: df[,3] [30 × 3]
##   doc_id      text                docvar1
##   <chr>       <chr>               <chr>  
## 1 Assam1.pdf  "\"          \"..." Assam1 
## 2 Assam10.pdf "\"          \"..." Assam10
## 3 Assam11.pdf "\"          \"..." Assam11
## 4 Assam12.pdf "\"          \"..." Assam12
## 5 Assam13.pdf "\"          \"..." Assam13
## 6 Assam14.pdf "\"          \"..." Assam14
## # … with 24 more rows

#create corpus

## [1] 30
##   docvar1
## 1  Assam1
## 2 Assam10
## 3 Assam11
## 4 Assam12
## 5 Assam13
## 6 Assam14
## Corpus consisting of 30 documents, showing 30 documents:
## 
##         Text Types Tokens Sentences docvar1
##   Assam1.pdf   418    877        45  Assam1
##  Assam10.pdf   311    538        19 Assam10
##  Assam11.pdf   192    331        12 Assam11
##  Assam12.pdf   302    591        22 Assam12
##  Assam13.pdf   306    770        19 Assam13
##  Assam14.pdf   298    592        20 Assam14
##  Assam15.pdf   215    435        14 Assam15
##  Assam16.pdf   174    312        10 Assam16
##  Assam17.pdf   326    639        20 Assam17
##  Assam18.pdf   339    691        28 Assam18
##  Assam19.pdf   225    464        17 Assam19
##   Assam2.pdf   171    302        11  Assam2
##  Assam20.pdf   471   1229        35 Assam20
##  Assam21.pdf   318    693        22 Assam21
##  Assam22.pdf   279    601        21 Assam22
##  Assam23.pdf   342    653        25 Assam23
##  Assam24.pdf   284    616        24 Assam24
##  Assam25.pdf   232    427        17 Assam25
##  Assam26.pdf   193    348        10 Assam26
##  Assam27.pdf   293    566        22 Assam27
##  Assam28.pdf   531   1130        49 Assam28
##  Assam29.pdf   190    388        12 Assam29
##   Assam3.pdf   261    515        15  Assam3
##  Assam30.pdf   443   1128        31 Assam30
##   Assam4.pdf   256    448        18  Assam4
##   Assam5.pdf   278    773        21  Assam5
##   Assam6.pdf   237    448        14  Assam6
##   Assam7.pdf   308    588        22  Assam7
##   Assam8.pdf   217    393        14  Assam8
##   Assam9.pdf   651   1644        51  Assam9

#create dfm

## Length  Class   Mode 
##  64830    dfm     S4

#Cleaning up using tokens

##             Length Class  Mode     
## Assam1.pdf  454    -none- character
## Assam10.pdf 288    -none- character
## Assam11.pdf 187    -none- character
## Assam12.pdf 294    -none- character
## Assam13.pdf 367    -none- character
## Assam14.pdf 294    -none- character
## Assam15.pdf 210    -none- character
## Assam16.pdf 168    -none- character
## Assam17.pdf 353    -none- character
## Assam18.pdf 362    -none- character
## Assam19.pdf 246    -none- character
## Assam2.pdf  161    -none- character
## Assam20.pdf 650    -none- character
## Assam21.pdf 325    -none- character
## Assam22.pdf 292    -none- character
## Assam23.pdf 342    -none- character
## Assam24.pdf 319    -none- character
## Assam25.pdf 221    -none- character
## Assam26.pdf 185    -none- character
## Assam27.pdf 286    -none- character
## Assam28.pdf 574    -none- character
## Assam29.pdf 200    -none- character
## Assam3.pdf  269    -none- character
## Assam30.pdf 600    -none- character
## Assam4.pdf  261    -none- character
## Assam5.pdf  372    -none- character
## Assam6.pdf  249    -none- character
## Assam7.pdf  308    -none- character
## Assam8.pdf  208    -none- character
## Assam9.pdf  823    -none- character

#kwic doesn’t work with dfm, so you have to use tokens

docname from to pre keyword post pattern
Assam1.pdf 16 16 edition washington post right reserv distribut maryland right
Assam10.pdf 20 20 british broadcast corpor right reserv length word right
Assam11.pdf 18 18 solut privat limit right reserv syndigate.info al right
Assam12.pdf 13 13 pm est u.p.i right reserv arabia iran right
Assam13.pdf 22 22 british broadcast corpor right reserv length word right
Assam14.pdf 16 16 coleman co ltd right reserv section guwahati right
Assam14.pdf 195 195 spoken gross human right violat indian state right
Assam14.pdf 280 280 inform hazarika reprint right timescontent.com water page right
Assam15.pdf 12 12 januari thursday pbd.in right reserv length word right
Assam17.pdf 19 19 gmt associat press right reserv section international right
Assam18.pdf 12 12 pm est u.p.i right reserv arabia iran right
Assam19.pdf 20 20 agenc franc press right reserv length word right
Assam2.pdf 12 12 thursday est u.p.i right reserv arabia iranian right
Assam20.pdf 11 11 friday week blitz right reserv length word right
Assam21.pdf 23 23 british broadcast corpor right reserv length word right
Assam22.pdf 17 17 solut privat limit right reserv length word right
Assam23.pdf 18 18 ht media ltd right reserv length word right
Assam24.pdf 13 13 pm est u.p.i right reserv arabia iran right
Assam25.pdf 15 15 ht media ltd right reserv length word right
Assam28.pdf 13 13 time newspap limit right reserv section overseas right
Assam30.pdf 12 12 ht media ltd right reserv length word right
Assam4.pdf 13 13 pm est u.p.i right reserv arabia iran right
Assam5.pdf 19 19 express distribut contify.com right reserv length word right
Assam6.pdf 13 13 wednesday est u.p.i right reserv arabia iranian right
Assam7.pdf 269 269 south asia human right document centr non-government right
Assam8.pdf 10 10 friday est u.p.i right reserv arabia iranian right
Assam9.pdf 13 13 ht media ltd right reserv length word right
Assam9.pdf 155 155 societi howev grow right wing lean agit right
docname from to pre keyword post pattern
Assam1.pdf 158 158 fight indian state independ homeland offici said independ
Assam11.pdf 142 142 rebel group fight independ homeland bodo tribe independ
Assam12.pdf 106 106 delhi issu sovereignti independ sovereignti core issu independ
Assam12.pdf 125 125 rebel group fight independ homeland assam said independ
Assam12.pdf 241 241 dutta accus mastermind independ day blast dhemaji independ
Assam12.pdf 271 271 seek greater autonomi independ say new delhi independ
Assam13.pdf 66 66 group north-east state independ faction appeal leader independ
Assam14.pdf 34 34 liber front asom independ leader paresh baruah independ
Assam14.pdf 188 188 statement activ tibetan independ assam dalai lama independ
Assam14.pdf 213 213 indian nation support independ tibet record june independ
Assam16.pdf 141 141 district ulfa fight independ homeland assam oper independ
Assam17.pdf 161 161 incid rebel fight independ homeland sinc step independ
Assam17.pdf 294 294 nation attent demand independ ethnic assames make independ
Assam18.pdf 331 331 push demand rang independ homeland autonomi within independ
Assam18.pdf 357 357 northeast sinc india independ load-dat februari end independ
Assam19.pdf 124 124 core issu sovereignti independ discuss talk ulfa independ
Assam19.pdf 129 129 talk ulfa fight independ assames homeland sinc independ
Assam2.pdf 98 98 telephon ulfa fight independ homeland sinc blame independ
Assam20.pdf 71 71 mani organ seek independ new delhi arrest independ
Assam20.pdf 193 193 goal kill movement independ assam well part independ
Assam20.pdf 577 577 leadership lead attain independ choos new leader independ
Assam20.pdf 585 585 lead victori war independ bangladesh pakistani govern independ
Assam20.pdf 615 615 bengali peopl creation independ bangladesh war liber independ
Assam20.pdf 627 627 assam also bring independ one day opin independ
Assam24.pdf 109 109 milit group fight independ homeland assam sinc independ
Assam24.pdf 139 139 besid demand sovereignti independ core issu talk independ
Assam24.pdf 250 250 nscn k fight independ tribal homeland nagaland independ
Assam25.pdf 89 89 separatist leader said independ birthright compromis give independ
Assam25.pdf 101 101 statement ulfa fight independ assames homeland sinc independ
Assam27.pdf 1 1 independ day bomb kill independ
Assam27.pdf 36 36 power bomb explod independ day parad india independ
Assam27.pdf 113 113 suspect group fight independ assam sinc bomb independ
Assam27.pdf 138 138 protect came celebr independ day said mr independ
Assam27.pdf 188 188 sinc indian gain independ britain august chief independ
Assam27.pdf 256 256 quiet water page independ day bomb kill independ
Assam28.pdf 2 2 battl independ threaten morn cuppa independ
Assam28.pdf 140 140 demand front fight independ assam sinc accus independ
Assam28.pdf 251 251 water page battl independ threaten morn cuppa independ
Assam28.pdf 305 305 million peopl assam independ kingdom six centuri independ
Assam28.pdf 313 313 british india won independ one countri three independ
Assam28.pdf 371 371 make money win independ attack just prove independ
Assam28.pdf 388 388 sovereignti -how assam independ mr bora insist independ
Assam28.pdf 502 502 output assam most independ state annex british independ
Assam28.pdf 515 515 influenc area sinc independ tension ethnic assames independ
Assam28.pdf 556 556 organis found seek independ assam indian rule independ
Assam28.pdf 566 566 water page battl independ threaten morn cuppa independ
Assam30.pdf 72 72 mani organ seek independ new delhi arrest independ
Assam30.pdf 194 194 goal kill movement independ assam well part independ
Assam30.pdf 575 575 leadership lead attain independ choos new leader independ
Assam4.pdf 118 118 said ulfa fight independ homeland assam oper independ
Assam5.pdf 3 3 talk without independ assam agenda say independ
Assam5.pdf 60 60 india will consid independ assam agenda want independ
Assam5.pdf 74 74 will take issu independ assam consider practic independ
Assam5.pdf 134 134 revolutionari stream lead independ asom barua current independ
Assam5.pdf 143 143 chief staff ulfa independ anti-talk faction renam independ
Assam5.pdf 228 228 world pick arm independ mother asom barua independ
Assam5.pdf 284 284 page talk without independ assam agenda say independ
Assam5.pdf 341 341 revolutionari stream lead independ asom struggl continu independ
Assam6.pdf 105 105 rebel group fight independ homeland sinc last independ
Assam8.pdf 105 105 asom ulfa fight independ homeland sinc rebel independ
Assam9.pdf 376 376 assam demand separ independ state much line independ
Assam9.pdf 432 432 ironic diehard support independ assam forgot exist independ
Assam9.pdf 453 453 assam state becom independ presenc mani alien independ
Assam9.pdf 537 537 arm group form independ state also set independ
docname from to pre keyword post pattern
Assam14.pdf 262 262 affair china name free speech tibetan dissent free
Assam9.pdf 63 63 assam make state free illeg infiltr come free
Assam9.pdf 745 745 sacrif make assam free outsid infiltr illeg free
docname from to pre keyword post pattern
docname from to pre keyword post pattern
Assam12.pdf 220 220 seri measur chalk decis taken intensifi militari decis
Assam24.pdf 177 177 assam sunday ulfa decis renew offer talk decis
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
Assam5.pdf 222 222 struggl gain recognit coloni govern india world coloni
Assam9.pdf 88 88 order end year coloni treatment centr solv coloni
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
Assam10.pdf 35 35 april ulfa unite liber front asom observ liber
Assam12.pdf 57 57 hold talk unite liber front asom ulfa liber
Assam13.pdf 59 59 anti-talk ulfa unite liber front assam separatist liber
Assam13.pdf 312 312 milit outfit bodo liber tiger lead format liber
Assam14.pdf 31 31 report anti-talk unite liber front asom independ liber
Assam14.pdf 116 116 leader said peopl liber armi set foot liber
Assam15.pdf 114 114 surrend belong nation liber front bengali nlfb liber
Assam15.pdf 125 125 adf nation santhal liber armi nsla other liber
Assam15.pdf 133 133 includ cadr unite liber front assam -independ liber
Assam15.pdf 146 146 ndfb insurg kamatapur liber organis klo member liber
Assam15.pdf 152 152 member rava nation liber front rnlf one liber
Assam16.pdf 60 60 friday discov unite liber front assam ulfa liber
Assam17.pdf 67 67 seen attempt unite liber front asom insurg liber
Assam18.pdf 173 173 ndfb outlaw unite liber front asom ulfa liber
Assam19.pdf 53 53 tuesday outlaw unite liber front asom ulfa liber
Assam2.pdf 57 57 suspect outlaw unite liber front asom ulfa liber
Assam20.pdf 2 2 aspir liber assam die week liber
Assam20.pdf 63 63 leader activist unite liber front assam ulfa liber
Assam20.pdf 295 295 water page aspir liber assam die get liber
Assam20.pdf 395 395 secretari gener unite liber front assam bangladeshi liber
Assam20.pdf 544 544 chetia new delhi liber movement analyst reject liber
Assam20.pdf 555 555 wild dream feel liber movement world ever liber
Assam20.pdf 618 618 independ bangladesh war liber goe vein freedom liber
Assam21.pdf 42 42 insurg group unite liber forc assam ulfa liber
Assam22.pdf 128 128 surrend belong nation liber front bengali nlfb liber
Assam22.pdf 139 139 adf nation santhal liber armi nsla other liber
Assam22.pdf 147 147 includ cadr unite liber front assam -independ liber
Assam22.pdf 160 160 ndfb insurg kamatapur liber organis klo member liber
Assam22.pdf 166 166 member rava nation liber front rnlf one liber
Assam23.pdf 171 171 separatist group unite liber front assam known liber
Assam24.pdf 77 77 commander-in-chief outlaw unite liber front asom ulfa liber
Assam24.pdf 206 206 go-between enabl unite liber front asom ulfa liber
Assam25.pdf 54 54 chairman outlaw unite liber front asom ulfa liber
Assam26.pdf 101 101 spurt activ unite liber front assam ulfa liber
Assam27.pdf 102 102 viewer outlaw unite liber front asom warn liber
Assam28.pdf 124 124 das kill unite liber front asom ulfa liber
Assam28.pdf 546 546 british annex unite liber front asom ulfa liber
Assam29.pdf 57 57 bring outlaw unite liber front assam ulfa liber
Assam3.pdf 72 72 talk deleg unite liber front assam ulfa liber
Assam30.pdf 1 1 liber struggl assam columnist liber
Assam30.pdf 64 64 leader activist unite liber front assam ulfa liber
Assam30.pdf 354 354 advoc water page liber struggl assam sahara liber
Assam30.pdf 394 394 secretari gener unite liber front assam bangladeshi liber
Assam30.pdf 542 542 chetia new delhi liber movement analyst reject liber
Assam30.pdf 553 553 wild dream feel liber movement world ever liber
Assam4.pdf 58 58 secretari utlaw unite liber front asom ulfa liber
Assam6.pdf 68 68 milit outlaw unite liber front asom ulfa liber
Assam7.pdf 142 142 barua command unite liber front asom ulfa liber
Assam8.pdf 100 100 attack outlaw unite liber front asom ulfa liber
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
Assam13.pdf 119 119 negoti centr reciproc equal strength willing usher equal
Assam9.pdf 335 335 karbi etc came equal demand separ state equal
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
Assam14.pdf 111 111 said refer india-china war milit leader said war
Assam20.pdf 584 584 ultim lead victori war independ bangladesh pakistani war
Assam20.pdf 617 617 creation independ bangladesh war liber goe vein war
Assam25.pdf 74 74 issu militarili know war solut various grievanc war
Assam9.pdf 130 130 dialogu section ulfa war cri aasu renew war
Assam9.pdf 209 209 border thank cold war south asia america war
docname from to pre keyword post pattern
docname from to pre keyword post pattern
## Tokens consisting of 30 documents and 1 docvar.
## Assam1.pdf :
##  [1] "kill"       "hurt"       "bomb"       "across"     "india"     
##  [6] "assam"      "state"      "washington" "post"       "october"   
## [11] "friday"     "suburban"  
## [ ... and 442 more ]
## 
## Assam10.pdf :
##  [1] "assam"       "separatist"  "india"       "mark"        "anniversari"
##  [6] "bbc"         "monitor"     "south"       "asia"        "polit"      
## [11] "suppli"      "bbc"        
## [ ... and 276 more ]
## 
## Assam11.pdf :
##  [1] "indian"     "frontier"   "guard"      "kill"       "ambush"    
##  [6] "separatist" "assam"      "iranian"    "govern"     "new"       
## [11] "juli"       "monday"    
## [ ... and 175 more ]
## 
## Assam12.pdf :
##  [1] "india"      "assam"      "reject"     "separatist" "precondit" 
##  [6] "talk"       "irna"       "august"     "sunday"     "pm"        
## [11] "est"        "u.p.i"     
## [ ... and 282 more ]
## 
## Assam13.pdf :
##  [1] "india"      "govern"     "call"       "peac"       "talk"      
##  [6] "separatist" "group"      "bbc"        "monitor"    "south"     
## [11] "asia"       "polit"     
## [ ... and 355 more ]
## 
## Assam14.pdf :
##  [1] "ulfa"      "seek"      "china"     "help"      "sovereign" "assam"    
##  [7] "time"      "india"     "toi"       "novemb"    "monday"    "bennett"  
## [ ... and 282 more ]
## 
## [ reached max_ndoc ... 24 more documents ]
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern

Assam.tokens2

#create dfm from first tokenized steps

#word cloud

#co-occurance

##     ulfa   chetia     talk   govern   author     anup     peac   indian 
##    14104    13325    12533    12385    12237     9999     9368     8576 
## rajkhowa     said 
##     8559     7981
##  [1] "ulfa"     "chetia"   "talk"     "govern"   "author"   "anup"    
##  [7] "peac"     "indian"   "rajkhowa" "said"     "leader"   "liber"   
## [13] "hand"     "nation"   "dhaka"    "violenc"  "independ" "outfit"  
## [19] "milit"    "water"    "surrend"  "two"      "act"      "end"     
## [25] "arabinda"