Skip to contents

Removes references from the input dataset that are duplicates already added to Zotero, preserving only those references that have been modified since their addition.

Usage

ZoteroCheck(
  data,
  id,
  id.type,
  created,
  last.modified,
  items,
  remove.duplicates = TRUE,
  silent = FALSE,
  log = list()
)

Arguments

data

A tibble containing metadata (e.g., from Cristin)

id

A string specifying the column name in data that contains the unique identifier (e.g., "cristin_result_id")

id.type

A string specifying the type of metadata as stored in the Zotero extra field (e.g., "Cristin")

created

A string specifying the column name in data containing the creation date in UNIX timestamp format (e.g., "created")

last.modified

A string specifying the column name in data containing the last modification date in UNIX timestamp format (e.g., "last_modified")

items

A data frame or tibble representing items in the Zotero library to check against

remove.duplicates

Logical. If TRUE, duplicates that have not been modified are removed. Default is TRUE.

silent

Logical. If TRUE, suppresses verbose output. Default is FALSE.

log

A list for storing log messages. Default is an empty list.

Value

A list with two elements: data, a tibble containing non-duplicated items, and log, the updated log list.

Details

For more details, see c2z documentation.

Examples

if (FALSE) { # \dontrun{
  # Simple Cristin search by id
  cristin.data <- Cristin(
    id = "840998",
    zotero.import = FALSE
  )

  # Checking Zotero library for duplicates
  result <- ZoteroCheck(
    data = cristin.data$result,
    id = "cristin_result_id",
    id.type = "Cristin",
    created = "created",
    last.modified = "last_modified",
    items = Zotero(
      user = FALSE,
      id = "4827927",
      api = "RqlAmlH5l1KPghfCseAq1sQ1",
      library = TRUE,
      silent = TRUE
    )$items
  )
} # }