Skip to content

Subsetting changes document names #2127

@koheiw

Description

@koheiw

Here, I am taking the second and the third sentences (.2 and .3), but the resulting documents have different names (.1 and .2)

> require(quanteda)
> corp <- corpus_reshape(data_corpus_inaugural)
> corp[c("1789-Washington.2", "1789-Washington.3")]
Corpus consisting of 2 documents and 4 docvars.
1789-Washington.1 :
"On the one hand, I was summoned by my Country, whose voice I..."

1789-Washington.2 :
"On the other hand, the magnitude and difficulty of the trust..."

> corpus_subset(corp, docnames(corp) %in% c("1789-Washington.2", "1789-Washington.3"))
Corpus consisting of 2 documents and 4 docvars.
1789-Washington.1 :
"On the one hand, I was summoned by my Country, whose voice I..."

1789-Washington.2 :
"On the other hand, the magnitude and difficulty of the trust..."

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions