bnosac / textplot

Text Plots
GNU General Public License v2.0
54 stars 8 forks source link

make textplot functions into generics #2

Closed kbenoit closed 4 years ago

kbenoit commented 4 years ago

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 to textplot_wordcloud() for keyness statistics, to get contrasting clouds of keywords. See https://github.com/quanteda/quanteda/pull/1940 for example.

jwijffels commented 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

jwijffels commented 4 years ago

Closing. Plot generics are now on CRAN.