Skip to content

selectFeatures apparently not working on first feature in a dfm #251

Description

@kbenoit

selectFeatures() should remove "My" as a feature but does not. Bug for the first feature in the dfm??

myDfm <- dfm(c("My Christmas was ruined by your opposition tax plan.",
               "Does the United_States or Sweden have more progressive taxation?"),
             toLower = FALSE, verbose = FALSE)
selectFeatures(myDfm, "My", "remove")
# Document-feature matrix of: 2 documents, 18 features.
#2 x 18 sparse Matrix of class "dfmSparse"
# features
# docs    My Christmas was ruined by your opposition tax plan Does the United_States or Sweden have
# text1  1         1   1      1  1    1          1   1    1    0   0             0  0      0    0
# text2  0         0   0      0  0    0          0   0    0    1   1             1  1      1    1
# features
# docs    more progressive taxation
# text1    0           0        0
# text2    1           1        1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions