Closed kbenoit closed 4 years ago
Indeed good suggestion. I made the changes in commit https://github.com/bnosac/textplot/commit/99ec74cd5e1576c976a0376b2c5d3cea65986087. All textplot_*()
functions are now S3 generic.
Feel free to contribute if you like. Note that
Imports
packages which are either base or recommended or data.table and in Suggests
other packages specific for the function and use requireNamespace('thepackage') where you need them in the functions. textplot
quickly.Closing. Plot generics are now on CRAN.
Looks good! We have too few options (and not enough imagination) when it comes to text visualizations and this is a good step forward.
Request: If you define each
textplot_*()
function as a generic, then it would be easy to extend with methods for other package objects, which I would be happy to contribute for quanteda for instance.This is how we have all of the
textplot_*()
functions in quanteda. This made it easier recently for me to add a new method totextplot_wordcloud()
for keyness statistics, to get contrasting clouds of keywords. See https://github.com/quanteda/quanteda/pull/1940 for example.