Skip to content

sample.corpus not working with corpus from character source from readLines #128

Description

@brooklynbagel

Hi,

First off I know there is textfile for reading a corpus source from a file but for my purposes it would not do since the texts are newline separated.

When I take a corpus whose source is from a character vector whose source is from readLines and call sample on it, the result is a corpus that appears to be an incorrect state instead of a character vector as expected. The functions that expect a corpus such as ndoc do function normally, and corpus$document is a vector of character instead of a data frame. However, setting the document-level meta-data prior to using sample seems to circumvent this issue.

Reproducibility:
R version 3.2.4 (2016-03-10)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.4 (El Capitan)
RStudio Version 0.99.893
quanteda_0.9.4
mybug.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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