Visualize term-frequency, inverse-document-frequency.
visualize_tfidf_at(..., token = NULL, doc = NULL, facet = doc,
color = facet, num_top = 10, scale_manual_base = default_scale_manual(),
scale_manual_params = list(), labs_base = default_labs(),
labs_params = list(title = "Highest TF-IDF Words"),
theme_base = default_theme(axis.text.y = ggplot2::element_text(angle = 30,
hjust = 1), panel.grid.major.y = ggplot2::element_blank()),
theme_params = list(), facet_base = default_facet(facet),
facet_params = list())
visualize_tfidf(..., token, doc, facet, color)
Arguments
| ... |
dots. Parameters to pass directly to visualize_time(). |
| token |
bare for NSE; character for SE. Name of column in data to use as unit for counting.
Probably something like 'word' or 'bigram'. |
| doc |
bare for NSE; character for SE. Name of column in data to use
as document in tidytext::bind_tf_idf(). |
| facet |
bare for NSE; character for SE. Name of column in data to use for facetting. |
| color |
bare for NSE; character for SE. Name of column in data to use for color basis.
Even if fill is the actual ggplot2 aesthetic, the internal code will 'coerce' this
column to fill.
In order to simplify internal code, MUST be specified. |
| num_top |
numeric. Number of words to show. If between 0 and 1, then assumed to be a percentage. |
| scale_manual_base |
list. Parameters to pass to ggplot2::scale_fill_manual() or
ggplot2::scale_color_manual(), depending on the aesthetic mapping. A default values
argument is specified in the internal
function default_scale_manual(),
so if overwriting explicitly, then values should be included in the list. |
| scale_manual_params |
list. Additional parameters to pass to ggplot2::scale_fill_manual()
or ggplot2::scale_color_manual() (e.g. breaks, labels, or name).
The default values specified by scale_manual_base = default_scale_manual()
can be overwritten a values argument in this list (or directly with a
values argument in the scale_manual_base list. |
| labs_base |
ggplot2::labs() function. Defaults to a pre-determined set of values.
It is recommended NOT to modify this argument; isntead, the _params argument should
be used for customization.
|
| labs_params |
list. Additional parameters to pass to ggplot2::labs() to use in addition
to and/or override the parameters set in the _base parameter. |
| theme_base |
ggplot2::theme() function. (e.g. as ggplot2::theme_minimal().)
A custom theme is supplied as a default. As with the the labs_base argument, it is NOT
recommended to change this directly.
|
| theme_params |
list. Additional parameters to pass to ggplot2::labs().
Should be used in the same manner as labs_params for customization. |
| facet_base |
ggplot2::facet_wrap() function. An internal function
sets defaults for facets, scales, ncol, nrow, and strip.position
As with the labs_base and theme_base arguments, it is NOT recommended to set
this argument explicitly; instead, the accompanying _params argument should be used.
|
| facet_params |
list. Additional parameters to pass to ggplot2::facet_wrap(). Parameters
passed to this argument override thos in the _base argument. |
Value
gg.
Details
Calls compute_tfidf_at() internally.
Cannot pass dots to compute_tfidf_at() internally because parameters
are used in subsequent processing.
See also
https://www.tidytextmining.com/tfidf.html.
https://juliasilge.com/blog/sherlock-holmes-stm/