## Package version: 2.1.2
## Parallel computing: 2 of 8 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

#create corpus

## readtext object consisting of 30 documents and 2 docvars.
## # Description: df[,4] [30 x 4]
##   doc_id             text                docvar1 docvar2 
##   <chr>              <chr>               <chr>   <chr>   
## 1 North_Cyprus1.pdf  "\" A Cyprus \"..." North   Cyprus1 
## 2 North_Cyprus10.pdf "\"  Cyprus: \"..." North   Cyprus10
## 3 North_Cyprus11.pdf "\"          \"..." North   Cyprus11
## 4 North_Cyprus12.pdf "\"          \"..." North   Cyprus12
## 5 North_Cyprus13.pdf "\"          \"..." North   Cyprus13
## 6 North_Cyprus14.pdf "\"          \"..." North   Cyprus14
## # ... with 24 more rows

#create corpus

## [1] 30
##   docvar1  docvar2
## 1   North  Cyprus1
## 2   North Cyprus10
## 3   North Cyprus11
## 4   North Cyprus12
## 5   North Cyprus13
## 6   North Cyprus14
## Corpus consisting of 30 documents, showing 30 documents:
## 
##                Text Types Tokens Sentences docvar1  docvar2
##   North_Cyprus1.pdf   827   2311       108   North  Cyprus1
##  North_Cyprus10.pdf   531   1237        43   North Cyprus10
##  North_Cyprus11.pdf   701   1614        55   North Cyprus11
##  North_Cyprus12.pdf  1788   6726       227   North Cyprus12
##  North_Cyprus13.pdf   515   1039        35   North Cyprus13
##  North_Cyprus14.pdf   356    742        26   North Cyprus14
##  North_Cyprus15.pdf   170    315        10   North Cyprus15
##  North_Cyprus16.pdf   595   1397        51   North Cyprus16
##  North_Cyprus17.pdf   515   1366        44   North Cyprus17
##  North_Cyprus18.pdf   571   1632        47   North Cyprus18
##  North_Cyprus19.pdf   342    746        29   North Cyprus19
##   North_Cyprus2.pdf   685   1540        55   North  Cyprus2
##  North_Cyprus20.pdf   344    988        22   North Cyprus20
##  North_Cyprus21.pdf   642   1687        53   North Cyprus21
##  North_Cyprus22.pdf   545   1286        57   North Cyprus22
##  North_Cyprus23.pdf  1349   4983       149   North Cyprus23
##  North_Cyprus24.pdf  2267  10221       444   North Cyprus24
##  North_Cyprus25.pdf   387    810        38   North Cyprus25
##  North_Cyprus26.pdf   219    400        15   North Cyprus26
##  North_Cyprus27.pdf   193    372        10   North Cyprus27
##  North_Cyprus28.pdf   263    578        19   North Cyprus28
##  North_Cyprus29.pdf   296    695        30   North Cyprus29
##   North_Cyprus3.pdf   238    500        21   North  Cyprus3
##  North_Cyprus30.pdf   385    905        36   North Cyprus30
##   North_Cyprus4.pdf   387   1025        41   North  Cyprus4
##   North_Cyprus5.pdf   879   2210        95   North  Cyprus5
##   North_Cyprus6.pdf   358    836        19   North  Cyprus6
##   North_Cyprus7.pdf   326    743        22   North  Cyprus7
##   North_Cyprus8.pdf   311    714        29   North  Cyprus8
##   North_Cyprus9.pdf   435    992        34   North  Cyprus9

#create dfm

## Length  Class   Mode 
## 131640    dfm     S4

#Cleaning up using tokens

##                    Length Class  Mode     
## North_Cyprus1.pdf  1103   -none- character
## North_Cyprus10.pdf  620   -none- character
## North_Cyprus11.pdf  820   -none- character
## North_Cyprus12.pdf 3406   -none- character
## North_Cyprus13.pdf  550   -none- character
## North_Cyprus14.pdf  380   -none- character
## North_Cyprus15.pdf  170   -none- character
## North_Cyprus16.pdf  658   -none- character
## North_Cyprus17.pdf  706   -none- character
## North_Cyprus18.pdf  741   -none- character
## North_Cyprus19.pdf  389   -none- character
## North_Cyprus2.pdf   802   -none- character
## North_Cyprus20.pdf  471   -none- character
## North_Cyprus21.pdf  778   -none- character
## North_Cyprus22.pdf  568   -none- character
## North_Cyprus23.pdf 2271   -none- character
## North_Cyprus24.pdf 4865   -none- character
## North_Cyprus25.pdf  415   -none- character
## North_Cyprus26.pdf  199   -none- character
## North_Cyprus27.pdf  207   -none- character
## North_Cyprus28.pdf  286   -none- character
## North_Cyprus29.pdf  323   -none- character
## North_Cyprus3.pdf   247   -none- character
## North_Cyprus30.pdf  451   -none- character
## North_Cyprus4.pdf   513   -none- character
## North_Cyprus5.pdf  1065   -none- character
## North_Cyprus6.pdf   416   -none- character
## North_Cyprus7.pdf   374   -none- character
## North_Cyprus8.pdf   359   -none- character
## North_Cyprus9.pdf   479   -none- character

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

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
North_Cyprus12.pdf 2271 2271 cyprus eu access fate turkish part inform fate
North_Cyprus24.pdf 608 608 hand state concern fate turkey surround middl fate
docname from to pre keyword post pattern
docname from to pre keyword post pattern
North_Cyprus10.pdf 9 9 date back british coloni meddl convers unite coloni
North_Cyprus10.pdf 147 147 legitim govern nicosia coloni aspect tend overlook coloni
North_Cyprus10.pdf 217 217 lausann treati remain coloni end 1950s water coloni
North_Cyprus10.pdf 230 230 date back british coloni meddl time island coloni
North_Cyprus10.pdf 264 264 henri hopkinson uk coloni affair minist gave coloni
North_Cyprus10.pdf 279 279 follow path british coloni gradual assist toward coloni
North_Cyprus10.pdf 431 431 separ repres various coloni institut divid popul coloni
North_Cyprus10.pdf 508 508 insurg call end coloni rule british use coloni
North_Cyprus10.pdf 597 597 date back british coloni meddl ilia xypolia coloni
North_Cyprus11.pdf 191 191 struggl forc british coloni forc withdraw complet coloni
North_Cyprus11.pdf 226 226 ethnic tension fact coloni hangov year british coloni
North_Cyprus11.pdf 230 230 hangov year british coloni author exercis trademark coloni
North_Cyprus11.pdf 567 567 enact polici settler coloni share broad contour coloni
North_Cyprus18.pdf 125 125 abandon benevol british coloni rule greek coloni coloni
North_Cyprus18.pdf 128 128 coloni rule greek coloni rule happi prospect coloni
North_Cyprus22.pdf 165 165 counsel act solictor-gener coloni worst eoka greek coloni
North_Cyprus23.pdf 1637 1637 ident follow end coloni period sens ident coloni
North_Cyprus24.pdf 374 374 offici becam british coloni movement enosi movement coloni
North_Cyprus24.pdf 484 484 hopkinson british minist coloni state alway recogn coloni
North_Cyprus25.pdf 74 74 broke former british coloni cyprus gain independ coloni
North_Cyprus29.pdf 86 86 power former british coloni cyprus gain independ coloni
North_Cyprus9.pdf 168 168 enclav brought peopl coloni communiti master state coloni
docname from to pre keyword post pattern
North_Cyprus1.pdf 1034 1034 collaps turkish forc occupi third island enforc occupi
North_Cyprus11.pdf 573 573 contour israeli design occupi palestinian territori unlike occupi
North_Cyprus14.pdf 158 158 northern cyprus illegitim occupi territori trade embargo occupi
North_Cyprus15.pdf 119 119 turkish troop invad occupi northern one-third eastern occupi
North_Cyprus17.pdf 121 121 greek republ turkish occupi island north turkey occupi
North_Cyprus17.pdf 129 129 exist republ cyprus occupi northern portion island occupi
North_Cyprus23.pdf 1432 1432 overarch ident societi occupi island allow hijack occupi
North_Cyprus24.pdf 50 50 width mile ottoman occupi island remain rule occupi
North_Cyprus24.pdf 2523 2523 effort greek side occupi tri incit ethno-nationalist occupi
North_Cyprus25.pdf 97 97 partit island militari occupi ethnic turkish north occupi
North_Cyprus26.pdf 134 134 troop station cyprus occupi northern third respons occupi
North_Cyprus29.pdf 121 121 cyprus north island occupi turkish republ northern occupi
North_Cyprus5.pdf 778 778 properti prevent visit occupi home north hundr occupi
North_Cyprus6.pdf 50 50 agreement illeg regim occupi area republ cyprus occupi
North_Cyprus6.pdf 308 308 turkey whose troop occupi cyprus northern part occupi
North_Cyprus6.pdf 339 339 turkish cypriot regim occupi cyprus delin call occupi
North_Cyprus7.pdf 242 242 flee north cyprus occupi turkey sinc runaway occupi
docname from to pre keyword post pattern
North_Cyprus5.pdf 918 918 final diplomat cost occupat now becom major occupat
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
North_Cyprus12.pdf 1805 1805 resolut describ armenian massacr genocid debat eu massacr
North_Cyprus13.pdf 260 260 interven cyprus stop massacr turkish cypriot one massacr
North_Cyprus13.pdf 315 315 divis island end massacr intern opinion welcom massacr
docname from to pre keyword post pattern
North_Cyprus24.pdf 391 391 demonstr began forc suppress british administr island suppress
docname from to pre keyword post pattern
docname from to pre keyword post pattern
docname from to pre keyword post pattern
North_Cyprus10.pdf 429 429 cypriot meant separ repres various coloni institut repres
North_Cyprus11.pdf 416 416 cyprus sole intern repres entir island greek repres
North_Cyprus12.pdf 458 458 militari turkish cypriot repres percent popul end repres
North_Cyprus12.pdf 1626 1626 drain northern cyprus repres turkey allow greec repres
North_Cyprus12.pdf 1794 1794 october u.s hous repres pressur white hous repres
North_Cyprus17.pdf 331 331 reservoir turkish govern repres northern portion cypriot repres
North_Cyprus17.pdf 523 523 year govern profession repres greek cypriot side repres
North_Cyprus18.pdf 472 472 tribun compos four repres one cyprus britain repres
North_Cyprus20.pdf 248 248 arabia least open repres offic island cyprus repres
North_Cyprus20.pdf 334 334 countri countri open repres offic republ ad repres
North_Cyprus23.pdf 143 143 realpolitik britain cypriot repres power greec turkey repres
North_Cyprus23.pdf 2053 2053 annan plan vote repres percent vote percent repres
North_Cyprus24.pdf 2904 2904 arriv rauf denktash repres greek cypriot settlement repres
North_Cyprus24.pdf 3020 3020 annan hectic negoti repres greek cypriot turkish repres
North_Cyprus29.pdf 30 30 c zackheo cypriot repres unite nation spoke repres
North_Cyprus29.pdf 47 47 european union zackheo repres greek cypriot govern repres
North_Cyprus29.pdf 157 157 fifth round negoti repres turkish cypriot decid repres
North_Cyprus29.pdf 274 274 cypriot speech way repres turkish cypriot expect repres
## Tokens consisting of 30 documents and 2 docvars.
## North_Cyprus1.pdf :
##  [1] "cyprus"        "world"         "pass"          "divid"        
##  [5] "island"        "turkish"       "north"         "retain"       
##  [9] "old-tim"       "mediterranean" "feel"          "catalina"     
## [ ... and 1,091 more ]
## 
## North_Cyprus10.pdf :
##  [1] "cyprus"  "danger"  "row"     "gas"     "explor"  "date"    "back"   
##  [8] "british" "coloni"  "meddl"   "convers" "unite"  
## [ ... and 608 more ]
## 
## North_Cyprus11.pdf :
##  [1] "cyprus"         "forgotten"      "occup"          "bikya"         
##  [5] "new"            "august"         "sunday"         "bikya"         
##  [9] "new"            "provid"         "syndigate.info" "albawaba.com"  
## [ ... and 808 more ]
## 
## North_Cyprus12.pdf :
##  [1] "cyprus"   "predict"  "crisi"    "nation"   "interest" "januari" 
##  [7] "nation"   "affair"   "inc"      "length"   "word"     "bylin"   
## [ ... and 3,394 more ]
## 
## North_Cyprus13.pdf :
##  [1] "cyprus"   "current"  "situat"   "daili"    "time"     "pk"      
##  [7] "novemb"   "saturday" "right"    "vision"   "new"      "right"   
## [ ... and 538 more ]
## 
## North_Cyprus14.pdf :
##  [1] "five"     "question" "turkish"  "republ"   "northern" "cyprus"  
##  [7] "agenc"    "franc"    "press"    "english"  "april"    "thursday"
## [ ... and 368 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
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

North_Cyprus.tokens2

#create dfm from first tokenized steps

#word cloud

#co-occurance

##    cypriot     turkey      union   european      greek  communiti membership 
##     204192     161199     136008     121618     116980      93440      90872 
##      relat     soviet     ankara 
##      84674      84173      80244
##  [1] "cypriot"    "turkey"     "union"      "european"   "greek"     
##  [6] "communiti"  "membership" "relat"      "soviet"     "ankara"    
## [11] "thus"       "eu"         "greec"      "parti"      "us"        
## [16] "quest"      "power"      "support"    "crisi"      "independ"  
## [21] "made"       "accept"     "effort"     "britain"    "ident"