plot_topic_segmentation | R Documentation |
Creates a Plotly sunburst chart that visualizes the hierarchical segmentation of referendum topic occurences.
plot_topic_segmentation(
data,
method = c("per_rfrnd", "per_topic_lineage", "naive")
)
data |
RDB referendum data as returned by |
method |
Applied method to count the number of topic occurences. One of
|
A topic lineage is the hierarchical compound of a topic_tier_1
and optionally a grandchild topic_tier_3
and/or a child topic_tier_2
.
Note that topics can be assigned on any tier to referendums (i.e. in one case, a topic_tier_1
plus a child topic_tier_2
is assigned, and in another case
only a topic_tier_1
without any further child topic).
Furthermore, it should be noted that not every topic_tier_2
has potential child topic_tier_3
s. See the full topic hierarchy
for details.
A plotly object.
Other visualization functions:
ggplot_streamgraph()
,
plot_rfrnd_share_per_period()
,
plot_topic_share_per_period()
# count each referendum equally
rdb::rfrnds(quiet = TRUE) |>
rdb::plot_topic_segmentation(method = "per_rfrnd")
# count each topic lineage equally
rdb::rfrnds(quiet = TRUE) |>
rdb::plot_topic_segmentation(method = "per_topic_lineage")
# naive count (way faster, but with misleading proportions on tier 2 and 3)
rdb::rfrnds(quiet = TRUE) |>
rdb::plot_topic_segmentation(method = "naive")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.