ManifestoCorpus
objects downloaded from the Manifesto
Corpus Database API via mp_corpus
.ManifestoDocument
s subclass the TextDocument
class
from the package tm
. Hence they can be and usually are collected in a tm
Corpus
to interface easily with text mining and other linguistic
analysis functions. manifestoR
uses the subclass
ManifestoCorpus
of tm
s Corpus
, but
ManifestoDocument
s can be stored in any kind of Corpus
.
As in tm
any ManifestoDocument has metadata which can be accessed and
modified via the meta
function, as well as content, accessible via
content
. Additionally, via codes()
, the coding of the
(quasi-)sentence ccording to the CMP category scheme can be accessed
(and modified).The CMP category scheme can be found online at
ManifestoDocument(content = data.frame(), id = character(0),
meta = ManifestoDocumentMeta())
codes
searches for the column named "cmp_code".ManifestoDocumentMeta
containing the metadata for this documentdata.frame
with a row for
every quasi-sentence and the columns text
and code
.corpus <- mp_corpus(subset(mp_maindataset(), countryname == "New Zealand"))
doc <- corpus[[1]]
print(doc)
Run the code above in your browser using DataLab