Skip to contents

Get the code identifiers from QNA codings

Usage

get_codeIds_from_qna_codings(
  x,
  within = "network",
  return = "all",
  includeUIDs = TRUE
)

Arguments

x

A parsed source or multiple parsed sources

within

Which type of network coding to look in

return

What to return ('all', 'nodes', 'edges', 'from', 'to')

includeUIDs

Whether to return the UIDs as well

Value

A character vector or data frame

Examples

### Get path to example source
examplePath <-
  system.file("extdata", package="rock");

### Read a souce coded with the Qualitative Network Approach
qnaExample <-
  rock::parse_source(
    file.path(
      examplePath,
      "network-example-1.rock"
    )
  );

rock::get_codeIds_from_qna_codings(
  qnaExample
);
#> $from
#>         codeId originalSequenceNr uid type
#> 2        tired                  2  NA from
#> 3       cranky                  3  NA from
#> 4       hungry                  4  NA from
#> 5       hungry                  4  NA from
#> 6     cheerful                  5  NA from
#> 7       coffee                  5  NA from
#> 8       coffee                  6  NA from
#> 9       coffee                  7  NA from
#> 10     weather                  8  NA from
#> 11     weather                  9  NA from
#> 12 warmWeather                 10  NA from
#> 13 warmWeather                 10  NA from
#> 
#> $to
#>      codeId originalSequenceNr uid type
#> 2    cranky                  2  NA   to
#> 3      mood                  3  NA   to
#> 4    cranky                  4  NA   to
#> 5    cranky                  4  NA   to
#> 6      mood                  5  NA   to
#> 7  cheerful                  5  NA   to
#> 8      drug                  6  NA   to
#> 9     tired                  7  NA   to
#> 10     mood                  8  NA   to
#> 11   hungry                  9  NA   to
#> 12  weather                 10  NA   to
#> 13   hungry                 10  NA   to
#> 
#> $type
#>        codeId originalSequenceNr uid type
#> 2  causal_pos                  2  NA type
#> 3  structural                  3  NA type
#> 4  causal_pos                  4  NA type
#> 5  causal_pos                  4  NA type
#> 6  structural                  5  NA type
#> 7  causal_pos                  5  NA type
#> 8  structural                  6  NA type
#> 9  causal_neg                  7  NA type
#> 10     causal                  8  NA type
#> 11     causal                  9  NA type
#> 12 structural                 10  NA type
#> 13 causal_neg                 10  NA type
#>