Produce the YAML for a ROCK codebook
Examples
data(exampleCodebook_1, package="rock");
cat(
codebook_to_yaml(
exampleCodebook_1
)
);
#> codebook:
#> metadata:
#> title: An example of an initial code book for a study into sleeping patterns
#> authorString: E. G. X. Ample
#> authorIds: .na.character
#> date: '2022-01-02'
#> organizational_mode: hierarchical
#> version: '1.0'
#> comments: |-
#> As the title indicates, this codebook is an example of an initial codebook. It is therefore unrealistically rudimentary, while still containing all elements. This example accompanies the ROCK Book (https://rockbook.org). To make this codebook applicable to situations where the Reproducible Open Coding Kit (the ROCK) is not used, we refer to the bits of data that are coded as data fragments (even though in the ROCK standard, codes are always applied to utterances).
#>
#> Note that this initial codebook example is meant as an illustration of the codebook's essential elements and of its structure, but not as an illustration of the content. How codes should be defined and described, how the concepts they capture relate to each other, how comprehensive coding instructions look, and which edge cases and examples are included is heavily dependent on a study's specific context, discipline, as well as relevant theories and researchers' experience and preconceptions. To keep this example brief, only very few codes are included, and in addition, for those few codes, the descriptions, coding instructions, and examples have all been kept very basic and rudimentary, and would not suffice for a real study. In terms of comprehensiveness, therefore, this example should not be viewed as a prototypical initial code book.
#> UCSID: https://code-repo-url.url/codebook/my_fancy_codebook_7hudfgd
#> UCR_prefix: https://code-repo-url.url/code/
#> positionality: I'm a woman
#> context: Politics are hard
#> narrative_process_documentation: https://process_documentation.com/my_word_file.docx
#> process_documentation_directives: https://process_documentation.com/PDD_736337
#> UCSID_version: '1.0'
#> URCID: .na.character
#> custom_field: Custom contents
#> codes:
#> - code_label: Social factors
#> code_description: 'Like most behaviors, sleeping behavior is influenced heavily
#> by social factors: factors relating to other people, for example to their behaviors,
#> their thoughts and preferences, and affordances created by existing in a social
#> structure.'
#> code_instruction: This code should only be attached to data fragments clearly
#> expressing both a social factor and its influence on somebody's sleeping patterns.
#> In addition, whenever a more specific code can be applied, apply that code,
#> such as descriptive_norms or living_in_sync. Expressions of social factors in
#> general should not be coded with this code.
#> code_id: social
#> ucr: social_7ybr17xt
#> ucr_prefix: .na.character
#> ucr_url: https://code-repo-url.url/code/social_7ybr17xt
#> ucid_url: .na.character
#> fillcolor: '#e69f00'
#> color: '#000000'
#> shape: oval
#> examples: []
#> relationships:
#> - to_code_id: descriptive_norms
#> relationship_type: parent_to_child
#> - to_code_id: living_in_sync
#> relationship_type: parent_to_child
#> - code_label: Descriptive norms
#> code_description: Descriptive norms are defined as somebody's perception of the
#> behavior of others in their environment (so-called "social referents"). Note
#> that this is different from injunctive norms, which refer to somebody's perception
#> of the approval or disapproval of social referents.
#> code_instruction: Apply this code when a data fragment expresses that somebody
#> engages in certain sleeping pattern-related behavior because (they believe)
#> other people do the same. This code should not be applied to people going to
#> bed earlier or later in response to *other* behaviors of others (e.g. going
#> to bed later because housemates play music until a late time).
#> code_id: descriptive_norms
#> ucr: descriptive_norms_7ybr17xw
#> ucr_prefix: https://code-repo2-url.url/code/
#> ucr_url: https://code-repo2-url.url/code/descriptive_norms_7ybr17xw
#> ucid_url: https://psycore.one/descriptiveNorms_73dnt5zp
#> fillcolor: '#56b4e9'
#> color: '#000000'
#> shape: oval
#> examples:
#> - example_fragment: In my family, everybody stays up late, we're just real night
#> owls.
#> obviousness: core
#> match: match
#> explanation: This explains why this is a match, as well as potentially why it's
#> not an edge case (but an obvious example of a match).
#> - example_fragment: My friends would think I'm boring if I would go to bed at
#> ten every night.
#> obviousness: core
#> match: mismatch
#> explanation: b
#> - example_fragment: It's too bad it's on so late, but my colleagues all watch
#> that series too.
#> obviousness: edge
#> match: match
#> explanation: c
#> - example_fragment: They sometimes stay up late to watch movies, so then I can't
#> sleep anyway because of the noise, so I might as well join them.
#> obviousness: edge
#> match: mismatch
#> explanation: d
#> relationships: []
#> - code_label: Synchronized living
#> code_description: When living together, people will often engage in certain acts
#> in a synchronized fashion, such as eating and sleeping.
#> code_instruction: Code data fragments with this code if they refer to benefits
#> that are directly derived from doing things at the same time with housemates.
#> This code should not be used to code fragments expressing indirectly obtained
#> benefits, such as avoidance of conflict.
#> code_id: living_in_sync
#> ucr: living_in_sync_7ybr17xx
#> ucr_prefix: .na.character
#> ucr_url: https://code-repo-url.url/code/living_in_sync_7ybr17xx
#> ucid_url: .na.character
#> fillcolor: '#009e73'
#> color: '#000000'
#> shape: oval
#> examples:
#> - example_fragment: We always go to sleep together, and we get up together, like
#> the saying, you know?
#> obviousness: core
#> match: match
#> explanation: e
#> - example_fragment: For some reason, my siblings go to sleep at the same time.
#> Even though we all moved to different places over two decades ago, that never
#> changed, weird, isn't it?
#> obviousness: core
#> match: mismatch
#> explanation: f
#> - example_fragment: We also save on heating and electricity costs. Imagine if
#> we'd go to bed at different times and woke up at very different times, that
#> would costs a fortune in heating alone!
#> obviousness: edge
#> match: match
#> explanation: g
#> - example_fragment: I would prefer to go to bed later, but they always say they
#> have to get up early and need their sleep, and I really don't like to have
#> discussions about that every time. You have to choose your battles.
#> obviousness: edge
#> match: mismatch
#> explanation: h
#> relationships: []
#> - code_label: Efficient living
#> code_description: 'People can feel that sleeping is waste of time: they could
#> spend that time working, recreating, or doing something else that is somehow
#> considered useful.'
#> code_instruction: Use this code for data fragments that express a goal conflict
#> related to time that can only be spent on sleeping versus some other activity.
#> Do not use this code for expressions of the benefits of sleeping or of getting
#> sufficient sleep.
#> code_id: efficient_living
#> ucr: efficient_living_7ybr17xy
#> ucr_prefix: .na.character
#> ucr_url: https://code-repo-url.url/code/social_7ybr17xt/efficient_living_7ybr17xy
#> ucid_url: .na.character
#> fillcolor: '#cc79a7'
#> color: '#000000'
#> shape: oval
#> examples:
#> - example_fragment: Sometimes I'm working on my book and then I see the time,
#> but then it's really hard to stop when I'm in the flow. I just want to keep
#> going - who knows whether I'll be in that same headspace tomorrow?
#> obviousness: core
#> match: match
#> explanation: i
#> - example_fragment: I really like sleeping. Can sleep count as a hobby? Would
#> definitely be in my top-10!
#> obviousness: core
#> match: mismatch
#> explanation: j
#> - example_fragment: Sometimes it's hard to go to bed, for example, when we're
#> in the middle of a nice movie. You know you should turn in, but if it's only
#> 30 more minutes... What's half an hour?
#> obviousness: edge
#> match: match
#> explanation: k
#> - example_fragment: If I don't get enough sleep, my productivity really suffers.
#> I notice that I can't really concentrate so well, and I start forgetting small
#> things. So yeah, I really make sure I sleep enough to make sure my work doesn't
#> suffer.
#> obviousness: edge
#> match: mismatch
#> explanation: l
#> relationships: []
#> aesthetics:
#> - type: graph
#> attribute: rankdir
#> value: LR
#> - type: node
#> attribute: shape
#> value: oval
#> - type: edge
#> attribute: color
#> value: black
