air_code_policy: Code AI policies on the codebook

View source: R/policy.R

air_code_policyR Documentation

Code AI policies on the codebook

Description

Reads the text of each policy and records, for every dimension of air_policy_codebook(), whether the policy addresses it ("stated", with the sentence as evidence) or not ("not_stated"). "not_stated" means the text does not say it, not that the policy allows or forbids it. A missing text gives "unverifiable".

Usage

air_code_policy(text, id = NULL, codebook = air_policy_codebook())

Arguments

text

A character vector of policy texts.

id

Identifiers, one per policy (for example journal or institution names).

codebook

The codebook; by default air_policy_codebook().

Details

Automatic coding is a first pass: the rules recognise common wordings, and a published analysis should have a person check the evidence of each "stated" and a sample of "not_stated" (see the evidence columns).

Value

A data frame in long format with one row per policy and dimension: id, codebook_version, dimension, group, value, evidence.

Examples

coded <- air_code_policy(c(
  paste("AI tools cannot be listed as authors.",
        "Authors must disclose the use of AI in the methods section."),
  "Reviewers must not upload manuscripts to AI tools, as this may breach confidentiality."
), id = c("Journal A", "Journal B"))
coded[coded$value == "stated", c("id", "dimension")]

AIRes documentation built on Nov. 23, 2026, 5:07 p.m.