Show and/or write the extractor instructions

write_extractor_instructions(
  x,
  output = "asis",
  outputFile = NULL,
  title = "Extractor Instructions",
  author = "",
  silent = TRUE
)

Arguments

x

An rxsStructure object, as imported by metabefor::rxs_fromSpecifications().

output

The format of the object to return: "asis" to return content ready to be included in a knitted file; "raw" for the raw results; or "none" to return the raw result invisibly.

outputFile

Optionally a file to write the extractor instructions to.

title, author

The title and author to use when exporting.

silent

Whether to be silent or chatty.

Value

A character vector with the extractor instructions in Markdown

Examples

### Load an example rxs specification
data("rxs_minimal_example_2", package="metabefor");

### "Write" the extractor instructions but store
### them in a character vector instead of writing
### them to a file
extractorInstructions <-
  metabefor::write_extractor_instructions(
    rxs_minimal_example_2
  );

### Show the beginning
cat(substr(extractorInstructions, 1, 265));
#> 
#> 
#> 
#> ### Extractor instructions
#> 
#> 
#> 
#> #### Introduction
#> 
#> These instructions are for extractors using the minimal rxs example.
#> 
#> 
#> 
#> #### More instructions
#> 
#> Normally, these instructions should be comprehensive enough to allow people to extract data reasonably accurately.
#> 
#> 

### Show a fragment with instructions about one entity
cat(substr(extractorInstructions, 2070, 2790));
#> 
#> #### Language
#> 
#> 
#> 
#> The written language of the article.
#> 
#> **Extraction instructions:** Note that articles are not excluded based on language. After the screening we look for people (e.g. colleagues or students) who can read a certain language. If not the article will be excluded. Use ISO 639-1 to extract this (see https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). If an article is written in a language that is not represented in ISO 639-1, extract using ISO 639-2 instead.
#> 
#> **Type:** Extractable Entity  
#> **Identifier:** `language`  
#> **Value description**: A single character value  
#> **Path in extraction script tree:** `source > general > language`  
#> **Value template**: `string`  
#> **Repeating**: `FALSE`
#> 
#> -----
#>