This function writes one or more JabRef configuration files that set a number of fields to be visible to screeners, so that you can mask the screeners from fields like journal, authors, and publication year.

write_JabRef_Config(
  outputPath,
  screeners = c("a", "b"),
  screenerFieldsPrefix = "screener",
  screenerFieldsSuffix = "status",
  screenerConfidencePrefix = "screener",
  screenerConfidenceSuffix = "confidence",
  fields = c("title", "abstract"),
  duplicateField = NULL,
  sortField = "title",
  sortDesc = FALSE,
  screeningType = "screening",
  jabrefVersion = "2.11.1",
  jabrefXML = NULL,
  batFile = NULL,
  generateSettingRemovalBatchFile = FALSE,
  screenerSuffixInFilename = FALSE
)

Arguments

outputPath

The path to write the file(s) to.

screeners

The strings to use to identify the screeners.

screenerFieldsPrefix, screenerFieldsSuffix

The prefix and suffix to attach to the screener identification strings to create the fields where the screeners store their decision.

screenerConfidencePrefix, screenerConfidenceSuffix

The prefix and suffix to attach to the screener identification strings to create the fields where the screeners store their confidence in their decision.

fields

The fields that have to be screened.

duplicateField

The field

sortField

The field to sort entries by.

sortDesc

Whether to sort in descending or ascending order.

screeningType

The type of screening (added to the filenames).

jabrefVersion

The version of JabRef to format the configuration file for.

jabrefXML

Optionally, the path to a file with a jabrefXML 'skeleton', in which certain, as yet undocumented, replacements will be made (but you can check the source code of the function in the meantime).

batFile

Optionally, contents of the batch file to write.

generateSettingRemovalBatchFile

Whether to write a batch file that edits the Windows registry to remove JabRef configuration, which may sometimes be necessary to get JabRef to use the XML configuration file.

screenerSuffixInFilename

Whether to add the screener identifier as a suffix to the file that is written.

Value

Invisibly, an object with the configuration file and intermediate steps.

Examples

### Get the path to a temporary directory
tempPath <- tempdir();

### Write screener packages
metabefor::write_JabRef_Config(
  tempPath,
  screeners = "A"
);

### Load written file
jabRefConfig <-
  readLines(
    file.path(
      tempPath,
      "jabref.xml"
    )
  );

### Show beginning of file
cat(jabRefConfig[1:10], sep="\n");
#> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
#> <!DOCTYPE preferences SYSTEM "http://java.sun.com/dtd/preferences.dtd">
#> <preferences EXTERNAL_XML_VERSION="1.0">
#>   <root type="user">
#>     <map/>
#>     <node name="net">
#>       <map/>
#>       <node name="sf">
#>         <map/>
#>         <node name="jabref">

### Show bit in the middle with specific screening info
cat(jabRefConfig[39:41], sep="\n");
#>             <entry key="customTabName_0" value="Screening"/>
#>             <entry key="customTabFields_0" value="title;abstract;screenerAstatus;screenerAconfidence"/>
#>             <entry key="columnNames" value="title;abstract;screenerAstatus"/>