Learn R Programming

RNewsflow (version 1.2.4)

document.network.plot: 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 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

Run this code
# NOT RUN {
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') 
# }

Run the code above in your browser using DataLab