You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
convert(., to = "stm") correctly drops empty documents, but the warning message suggests that all documents are dropped.
Reproducible code
# documents with one empty documentdocs<- c("",
"not empty",
"also not empty")
# tokens -> dfm -> convert to stm formatdocs|>
tokens() |>
dfm() |>
convert(to="stm")
>Warningmessage:>In dfm2stm(x, docvars, omit_empty=TRUE) :Dropped3empty document(s)
Expected behavior
The warning should state that 1 and not 3 empty documents are dropped.
It might even be better to throw an error so that the empty documents have to be dropped beforehand.
## System information
R version 4.3.2 (2023-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.3 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=de_DE.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=de_DE.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=de_DE.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C
time zone: Europe/Berlin
tzcode source: system (glibc)
attached base packages:
[1] stats graphics grDevices datasets utils methods base
other attached packages:
[1] quanteda_3.3.1
Additional info
Please add any other information about the issue.
The text was updated successfully, but these errors were encountered:
Describe the bug
convert(., to = "stm")
correctly drops empty documents, but the warning message suggests that all documents are dropped.Reproducible code
Expected behavior
The warning should state that 1 and not 3 empty documents are dropped.
It might even be better to throw an error so that the empty documents have to be dropped beforehand.
## System information
Additional info
Please add any other information about the issue.
The text was updated successfully, but these errors were encountered: