Skip to contents

Address a passage either by segment number (as shown in qda_view()) or by explicit 1-based character offsets start/end into the frozen text. Offsets are validated against the frozen text, so a coding can never point outside the source.

Usage

qda_code(source, code, segment = NULL, start = NULL, end = NULL, memo = "")

Arguments

source

Source id or unique name.

code

Code id or unique label.

segment

Segment number (see qda_view()). Mutually exclusive with start/end.

start, end

1-based inclusive character offsets into the frozen text.

memo

Optional memo attached to this coding.

Value

Invisibly, a one-row tibble describing the new coding.

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("SME", parent = "Career path")
qda_code(source = 1, segment = 2, code = "Career path")
qda_code(source = "interview_01.txt", start = 120, end = 200,
         code = "SME", memo = "5 years in an SME")
qda_codings()
#> # A tibble: 2 × 11
#>      id source_id source        code_id code  start   end memo  text  paraphrase
#>   <int>     <int> <chr>           <int> <chr> <int> <int> <chr> <chr> <chr>     
#> 1     1         1 interview_01…       1 Care…   104   202 ""    Inte… ""        
#> 2     2         1 interview_01…       2 SME     120   200 "5 y… d mo… ""        
#> # ℹ 1 more variable: generalization <chr>
qda_close()