Skip to contents

Walks through every document segment by segment (in text order) and lists the codes each segment contains. Drawn as a strip per document (qda_plot_portrait()), this shows at a glance where in an interview a theme comes up – at the start, throughout, only at the end – and makes interviews comparable.

Usage

qda_portrait(source = NULL, level = c("top", "code"), min_overlap = 1L)

Arguments

source

Optional documents (ids or names); default all.

level

"top" (default: code families, one colour each) or "code" (every code and subcode).

min_overlap

Minimum number of characters a coding must overlap a segment to count.

Value

A tibble with one row per segment and code (segments without codes have code = NA): source_id, source, segment, start, end, pos (share of the document before the segment, 0–1), width (share of the document the segment takes), code, color.

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(1, "Career path", segment = 3)
qda_code(1, "Motivation", segment = 7)
qda_portrait()
#> # A tibble: 7 × 9
#>   source_id source           segment start   end   pos  width code        color 
#>       <int> <chr>              <int> <int> <int> <dbl>  <dbl> <chr>       <chr> 
#> 1         1 interview_01.txt       1     1   101 0     0.118  NA          NA    
#> 2         1 interview_01.txt       2   104   202 0.120 0.116  NA          NA    
#> 3         1 interview_01.txt       3   205   325 0.238 0.141  Career path #E69F…
#> 4         1 interview_01.txt       4   328   370 0.382 0.0502 NA          NA    
#> 5         1 interview_01.txt       5   373   605 0.435 0.272  NA          NA    
#> 6         1 interview_01.txt       6   608   647 0.709 0.0467 NA          NA    
#> 7         1 interview_01.txt       7   650   856 0.758 0.242  Motivation  #56B4…
qda_close()