use(pkg = "RcppCWB", corpus = "REUTERS")
P <- partition("REUTERS", places = "argentina")
H <- html(P)
if (interactive()) H # show full text in viewer pane
# html-method can be used in a pipe
H <- partition("REUTERS", places = "argentina") %>% html()
# use html-method to get full text where concordance occurrs
K <- kwic("REUTERS", query = "barrels")
H <- html(K, i = 1, s_attribute = "id")
H <- html(K, i = 2, s_attribute = "id")
for (i in 1L:length(K)) {
H <- html(K, i = i, s_attribute = "id")
if (interactive()){
show(H)
userinput <- readline("press 'q' to quit or any other key to continue")
if (userinput == "q") break
}
}
Run the code above in your browser using DataLab