Skip to contents

The units (segments or documents) that contain both codes – or, with unit = "overlap", the stretches of text where codings of the two codes overlap. This is what you read after spotting a pair in qda_cooccurrence(), the heatmap or the network.

Usage

qda_cooccurrence_passages(
  code_a,
  code_b,
  unit = c("segment", "document", "overlap"),
  level = c("code", "top"),
  source = NULL,
  min_overlap = 1L
)

Arguments

code_a, code_b

Code paths (e.g. "Career path / Small company") or unique labels; with level = "top" the top-level codes.

unit

"segment" (both codes in the same segment), "document" (somewhere in the same document) or "overlap" (the codings share text).

level

"code" (every code and subcode) or "top" (code families: a code together with its subcodes).

source

Optional documents (ids or names); default all.

min_overlap

Minimum number of characters a coding must overlap a unit (or, with unit = "overlap", the other coding).

Value

A tibble: source_id, source, segment, start, end, text.

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("Motivation"); qda_code_add("Team")
qda_code(1, "Motivation", segment = 7)
qda_code(1, "Team", segment = 7)
qda_cooccurrence_passages("Motivation", "Team")
#> # A tibble: 1 × 6
#>   source_id source           segment start   end text                           
#>       <int> <chr>              <int> <int> <int> <chr>                          
#> 1         1 interview_01.txt       7   650   856 Respondent: Above all the dire…
qda_close()