Attaches sframe_reference() records to an instrument. A reference whose id is
already present replaces the old one when replace = TRUE, and is refused
otherwise, which keeps a second source from silently taking over a citation key.
cited_by targets of a replaced reference are merged.
Arguments
- instrument
An
sframeobject.- ...
sf_referenceobjects, or lists of them such asread_bibtex()returns.- replace
Logical. Replace a reference with the same id.
Details
Adding references changes the file hash, as any edit does, and leaves the
content hash that amend_sframe() records unchanged: citing a source is
disclosure, outside the design.
See also
Other References functions:
read_bibtex(),
sframe_bibliography(),
sframe_get_references(),
sframe_reference()
Examples
instr <- sframe_instrument("Demo", components = list(
sframe_item("q1", "How satisfied are you?", "likert", choice_set = "agree5"),
sframe_choice_set("agree5", 1:5, c("SD", "D", "N", "A", "SA"))
))
instr <- sframe_add_references(instr, sframe_reference(
"likert_1932", "A technique for the measurement of attitudes",
author = "Likert, R.", year = 1932, container = "Archives of Psychology",
volume = "22", issue = "140", pages = "1-55", cited_by = "item:q1"
))
length(sframe_get_references(instr))