relation: Create relation codes. Used inside of annotation_variable

View source: R/annotation_variable.r

relationR Documentation

Create relation codes. Used inside of annotation_variable

Description

Create relation codes. Used inside of annotation_variable

Usage

relation(
  codes,
  from_variable,
  to_variable,
  from_values = NULL,
  to_values = NULL
)

Arguments

codes

A character vector with the code values. These need to correspond to codes specified in the 'codes' argument of annotation_variable

from_variable

The name of a variable in the codebook. This specifies from which variable the relation starts at. (if you need multiple from variables, note that you can create multiple relations)

to_variable

Like from_variable, but for specifying where the relation goes to

from_values

Optionally, specify specific code values within the from variable. If not specified, all code values in the from_variable can be used

to_values

Like from_values

Value

A codeRelation code object

Examples

label_var <- annotation_variable("Labels", "Span annotations", codes = c("Person", "Issue"))
relation_var <- annotation_variable("Relations", "Relation annotations",
  code = c(green = "Positive stance", grey = "Neutral stance", red = "Negative stance"),
  relations = relation(c("Positive stance", "Neutral stance", "Negative stance"),
    from_variable = "Labels", from_values = "Person",
    to_variable = "labels", to_values = "Issue"
  )
)

ccs-amsterdam/ccsAnnotator documentation built on March 19, 2024, 2:14 a.m.