quanteda / quanteda.textplots

Plotting and visualisation for quanteda
GNU General Public License v3.0
6 stars 1 forks source link

Facet for empty documents shown incorrectly when no match occurs and scale = "relative" #16

Open kbenoit opened 2 years ago

kbenoit commented 2 years ago

There should be a gray section for the 2013-Obama speech for "nuclear" corresponding the same area for "econom*".

library("quanteda")
## Package version: 3.2.0
## Unicode version: 13.0
## ICU version: 69.1
## Parallel computing: 8 of 8 threads used.
## See https://quanteda.io for tutorials and examples.

toks <- data_corpus_inaugural %>%
  corpus_subset(President == "Obama") %>%
  tokens()
kw1 <- kwic(toks, "nuclear")
kw2 <- kwic(toks, "econom*")

library("quanteda.textplots")
textplot_xray(kw1, kw2, scale = "absolute")
## Warning: Use of `x$ntokens` is discouraged. Use `ntokens` instead.