Skip to contents

Draws qda_cooccurrence() as a network: every code is a circle (colour of its code family, size = how often it was used), a line connects two codes that occur together (thicker = more often). With layout = "circle" the codes sit in code-tree order around a circle, so code families stay next to each other; layout = "force" pulls related codes together. Hovering shows the numbers; in the app a click on a line lists the passages.

Usage

qda_plot_network(
  x = NULL,
  min_n = 1L,
  layout = c("circle", "force"),
  size = 560,
  file = NULL,
  ...
)

Arguments

x

Result of qda_cooccurrence(); if NULL it is computed with ....

min_n

Draw only lines for pairs that occur together at least this often.

layout

"circle" or "force".

size

Width and height of the drawing area in pixels.

file

Optional path: write the SVG there instead of returning it.

...

Arguments for qda_cooccurrence() (e.g. unit, level).

Value

The SVG as an HTML object (printing shows it in the RStudio Viewer), or invisibly file.

Examples

qda_open(file.path(tempfile(), "example.jellyqda"))
qda_import(system.file("extdata", "interview_01.txt", package = "jellyqda"))
#> # A tibble: 1 × 5
#>      id name             format chars status
#>   <int> <chr>            <chr>  <int> <chr> 
#> 1     1 interview_01.txt txt      856 ok    
qda_code_add("Career path"); qda_code_add("Motivation"); qda_code_add("Team")
qda_code(1, "Career path", segment = 5); qda_code(1, "Motivation", segment = 5)
qda_code(1, "Motivation", segment = 7); qda_code(1, "Team", segment = 7)
svg <- qda_plot_network()
svg <- qda_plot_network(layout = "force", level = "top")
qda_close()