## Not run:
# use("polmineR.sampleCorpus")
# P <- partition("PLPRBTTXT", text_date = "2009-10-27")
# ngramObject <- ngrams(P, n = 2, pAttribute = "word", char = NULL)
# # a more complex scenario: get most frequent ADJA/NN-combinations
# ngramObject <- ngrams(P, n = 2, pAttribute = c("word", "pos"), char = NULL)
# ngramObject2 <- subset(
# ngramObject,
# ngramObject[["1_pos"]] == "ADJA" & ngramObject[["2_pos"]] == "NN"
# )
# ngramObject2@stat[, "1_pos" := NULL, with = FALSE][, "2_pos" := NULL, with = FALSE]
# ngramObject3 <- sort(ngramObject2, by = "count")
# head(ngramObject3)
# ## End(Not run)
Run the code above in your browser using DataLab