plot_nc: Plot narrative centrality scores using ggplot2

View source: R/narrative_centrality.R

plot_ncR Documentation

Plot narrative centrality scores using ggplot2

Description

Create a quick line graph showing character trajectories through narrative time based on their narrative centrality scores.

Usage

plot_nc(input_scores, label_all = FALSE, title = "")

Arguments

input_scores

The N-by-T matrix exported from the narrative_centrality function.

label_all

Logical. If TRUE, each character in the line graph will be labelled. If FALSE, only those characters whose normalised scores at the end of the narrative are higher than their normalised scores at the start are labelled (if input scores are not normalised, this won't have any effect).

title

An optional character string which can be used to add a title to the visualisation.

Value

A ggplot2 plot.

Examples

tfa <- movienetdata::starwars_tfa
tfa_scores <- narrative_centrality(tfa$event_list,
                                   char_names = tfa[[2]]$char_name,
                                   wp = 0.01,
                                   from = 3)
plot_nc(tfa_scores$out_scores)


pj398/charinet documentation built on May 2, 2024, 10:28 p.m.