I talked about this with @kbenoit earlier on, but now I remember the exact issue. While summary(corpus) is helpful, head(corpus) doesn't print any useful output.
library(quanteda)
head(data_corpus_inaugural)
# > head(data_corpus_inaugural)
# ... <truncated>
# ... <truncated>
# ... <truncated>
# ... <truncated>
# ... <truncated>
# "When it was first perceived, in early times, that no middle course for America remained between
# unlimited submission to a foreign legislature and a total independence of its claims, men of reflection were less apprehensive of danger from the formidable power of fleets and armies they
# must determine to resist than from those contests and dissensions which would certainly arise
# concerning the forms of government to be instituted over the whole and over the parts of this extensive country. Relying, however, on the purity of their intentions, the justice of their cause,
# and the integrity and intelligence of the people, under an overruling Providence which had so
# signally protected this country from the first, the representatives of this nation, then consisting of
# little more than half its present number, not only broke to pieces the chains which were forging and
# the rod of iron that was lifted up, but frankly cut asunder the ties which had bound them, and launched into an ocean of uncerta... <truncated>
I was wondering whether a head.corpus class could replicate summary.corpus, but will also display the first few tokens of each document? As head.dfm is specified, for consistency it might make sense to create head.corpus as well.
I talked about this with @kbenoit earlier on, but now I remember the exact issue. While
summary(corpus)is helpful,head(corpus)doesn't print any useful output.I was wondering whether a
head.corpusclass could replicatesummary.corpus, but will also display the first few tokens of each document? Ashead.dfmis specified, for consistency it might make sense to createhead.corpusas well.