document_network_plot: Visualize (a subcomponent) of the document similarity network

View source: R/networks.r

document_network_plotR Documentation

Visualize (a subcomponent) of the document similarity network

Description

Visualize (a subcomponent) of the document similarity network

Usage

document_network_plot(
  g,
  date_attribute = "date",
  source_attribute = "source",
  subcomp_i = NULL,
  dtm = NULL,
  sources = NULL,
  only_outer_date = FALSE,
  date_format = "%Y-%m-%d %H:%M",
  margins = c(5, 8, 1, 13),
  isolate_color = NULL,
  source_loops = TRUE,
  ...
)

Arguments

g

A document similarity network, as created with newsflow_compare or create_document_network

date_attribute

The label of the vertex/document date attribute. Default is "date"

source_attribute

The label of the vertex/document source attribute. Default is "source"

subcomp_i

Optional. If an integer is given, the network is decomposed into subcomponents (i.e. unconnected components) and only the i-th component is visualized.

dtm

Optional. If a document-term matrix that contains the documents in g is given, a wordcloud with the most common words of the network is added.

sources

Optional. Use a character vector to select only certain sources

only_outer_date

If TRUE, only the labels for the first and last date are reported on the x-axis

date_format

The date format of the date labels (see format.POSIXct)

margins

The margins of the network plot. The four values represent bottom, left, top and right margin.

isolate_color

Optional. Set a custom color for isolates

source_loops

If set to FALSE, all edges between vertices/documents of the same source are ignored.

...

Additional arguments for the network plotting function plot.igraph

Value

Nothing.

Examples

docnet = docnet
dtm = rnewsflow_dfm

docnet_comps = igraph::decompose.graph(docnet) # get subcomponents

# subcomponent 1
document_network_plot(docnet_comps[[1]]) 

# subcomponent 2 with wordcloud
document_network_plot(docnet_comps[[2]], dtm=dtm) 

# subcomponent 3 with additional arguments passed to plot.igraph 
document_network_plot(docnet_comps[[3]], dtm=dtm, vertex.color='red') 

RNewsflow documentation built on May 31, 2023, 6:53 p.m.