Skip to content

convert to="stm" indexes from 0 instead of 1 #222

Description

@bstewart

Ken- as always, amazing package.

Thanks so much for having a converter out to stm. Defying conventions of all programming languages except R we index our documents object from 1 instead of 0. The converter for stm indexes from 1 in the current development and CRAN versions. Replication code below using some data we have in our package

#devtools::install_github("kbenoit/quanteda")
library(stm)
library(quanteda)
corp<-corpus(gadarian,textField="open.ended.response")
stmdfm <- convert(myDfm, to = "stm") 
storage<-stm(stmdfm$documents,stmdfm$vocab,K=7) #throws an error
stmdfm$documents$`344` #hey look that first index is 0!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions