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
Suppose dfm_data contains 1595 features. The user wants to see all of them to quickly scroll if the features are sensible. Users may probably go for something like this to View( ) the features and call textstat_frequency(dfm_data, 2000) %>% View(). However, this results in 2000 - 1595 = 405 columns at the tail of data.frame to be labelled as NA due "group" column running above the maximum possible number. See screenshot:
Reproducible code
Please paste minimal code that reproduces the bug. If possible, please upload the data file as .rds.
Thanks, that's a bug! Affects the result with groups too.
Here's a simpler reproducible example:
library("quanteda")
## Package version: 2.0.2corp<- c("a a b c d", "a d d e", "a b b")
dfmat<- dfm(corp)
# should not have NA
textstat_frequency(dfmat, n=6)
## feature frequency rank docfreq group## 1 a 4 1 3 all## 2 b 3 2 2 all## 3 d 3 2 2 all## 4 c 1 4 1 all## 5 e 1 4 1 all## 6 <NA> NA NA NA all
textstat_frequency(dfmat, n=6, groups= c(1, 2, 2))
## feature frequency rank docfreq group## 1 a 2 1 1 1## 2 b 1 2 1 1## 3 c 1 2 1 1## 4 d 1 2 1 1## 5 <NA> NA NA NA 1## 6 <NA> NA NA NA 1## 7 a 2 1 2 2## 8 b 2 1 1 2## 9 d 2 1 1 2## 10 e 1 4 1 2## 11 <NA> NA NA NA 2## 12 <NA> NA NA NA 2
Describe the bug
Suppose dfm_data contains 1595 features. The user wants to see all of them to quickly scroll if the features are sensible. Users may probably go for something like this to
![image](https://user-images.githubusercontent.com/7356171/79576827-c58fd980-80bb-11ea-9e6c-f8caadda94bc.png)
View( )
the features and calltextstat_frequency(dfm_data, 2000) %>% View()
. However, this results in 2000 - 1595 = 405 columns at the tail of data.frame to be labelled asNA
due "group" column running above the maximum possible number. See screenshot:Reproducible code
Please paste minimal code that reproduces the bug. If possible, please upload the data file as
.rds
.Expected behavior
The View() should not continue over the maximum possible number of features in data.frame and stop at whatever the max value of
nfeat(dfm(test))
is.## System information
Please run
sessionInfo()
and paste the output.The text was updated successfully, but these errors were encountered: