Skip to contents

Draws qda_portrait(): every document is a strip from its start (left) to its end (right), every segment a block as wide as its share of the text, coloured by the codes it contains. Strips of several documents underneath each other show where in the interviews the themes come up. Hovering a block names the segment and its codes; in the app a click jumps to the segment.

Usage

qda_plot_portrait(x = NULL, width = 760, interactive = TRUE, file = NULL, ...)

Arguments

x

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

width

Width of the strips in pixels.

interactive

Logical; TRUE (default) gives every block a tooltip and a click target (app, Viewer). FALSE (used for the printed report) leaves them out and merges neighbouring segments with the same codes – the picture is the same, the file much smaller in large projects.

file

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

...

Arguments for qda_portrait() (e.g. level, source).

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", c("interview_01.txt", "interview_02.md"), package = "jellyqda"))
#> # A tibble: 2 × 5
#>      id name             format chars status
#>   <int> <chr>            <chr>  <int> <chr> 
#> 1     1 interview_01.txt txt      856 ok    
#> 2     2 interview_02.md  md       531 ok    
qda_code_add("Career path"); qda_code_add("Team")
qda_code(1, "Career path", segment = 3)
qda_code(2, "Team", segment = 5)
svg <- qda_plot_portrait()
qda_close()