Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subsetting changes document names #2127

Closed
koheiw opened this issue Aug 12, 2021 · 0 comments
Closed

Subsetting changes document names #2127

koheiw opened this issue Aug 12, 2021 · 0 comments
Assignees
Labels

Comments

@koheiw
Copy link
Collaborator

koheiw commented Aug 12, 2021

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..."
@koheiw koheiw added the bug label Aug 12, 2021
@koheiw koheiw self-assigned this Aug 12, 2021
@koheiw koheiw mentioned this issue Aug 12, 2021
@kbenoit kbenoit closed this as completed Aug 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants