Skip to contents

Use search parameters for the Cristin API and return the results as a tibble. See CristinWrangler

Usage

Cristin(
  id = NULL,
  doi = NULL,
  title = NULL,
  contributor = NULL,
  issn = NULL,
  unit = NULL,
  institution = NULL,
  user = NULL,
  category = NULL,
  published_since = NULL,
  published_before = NULL,
  created_since = NULL,
  created_before = NULL,
  modified_since = NULL,
  modified_before = NULL,
  year_reported = NULL,
  project_code = NULL,
  funding_source = NULL,
  funding = NULL,
  lang = NULL,
  page = 1,
  per_page = 1000,
  max.results = NULL,
  no.results = FALSE,
  sort = NULL,
  filter = NULL,
  fields = "all",
  open.query = NULL,
  all.results = TRUE,
  force = FALSE,
  remove.duplicates = TRUE,
  base.url = "https://api.cristin.no/v2/results",
  custom.url = NULL,
  use.identifiers = TRUE,
  use.multisession = FALSE,
  min.multisession = 25,
  n.workers = NULL,
  handler = NULL,
  restore.defaults = TRUE,
  zotero = NULL,
  zotero.import = TRUE,
  zotero.check = TRUE,
  nvi = FALSE,
  remove.na = TRUE,
  replace.na = "book",
  force.type = NULL,
  silent = FALSE,
  log = list()
)

Arguments

id

The Cristin id of the result, Default: NULL

doi

DOI name (e.g. doi=10.1000/123456), Default: NULL

title

The title of the result, Default: NULL

contributor

Author's name or Cristin person id, Default: NULL

issn

The issn of the result, Default: NULL

unit

Id (e.g. unit=185.53.18.10), Default: NULL

institution

Id (one number, e.g. institution=185), name or acronym of the institution the contributors belong to, Default: NULL

user

A person's username in Cristin together with the institution id separated by colon (e.g., `askeladd:185`), Default: NULL

category

Categories. See category codes, Default: NULL

published_since

Results published since and inclusive the given year, (yyyy), Default: NULL

published_before

Results published before and inclusive the given year, (yyyy), Default: NULL

created_since

Results created since and inclusive the given date, (yyyy-mm-dd), Default: NULL

created_before

Results created before and inclusive the given date, (yyyy-mm-dd), Default: NULL

modified_since

Results modified since and inclusive the given date, (yyyy-mm-dd), Default: NULL

modified_before

Results modified before and inclusive the given date, (yyyy-mm-dd), Default: NULL

year_reported

The year a result was reported, Default: NULL

project_code

Project code is the internal reference number used by funding source, Default: NULL

funding_source

Funding source code e.g: NFR, Default: NULL

funding

Funding source code e.g: NFR, and project_code together separated by colon (e.g., NFR:1234), Default: NULL

lang

Two letter language code, Default: NULL

page

Page number. See pagination, Default: 1

per_page

Number of items per page (1000 is max). See pagination, Default: 1000

max.results

Do you need a limit?, Default: NULL

no.results

Do you need only the number of results?, Default: FALSE

sort

Sorts on `category` and/or `year_published`. See search and sort. Default sort order is on `cristin_result_id` in ascending order, Default: NULL

filter

Vector of cateogries to include in results. See category code, Default: NULL

fields

`fields = all` gives a list of result objects with all available fields. If this parameter is omitted, a list of result summaries with fewer fields will be returned, Default: all

open.query

Define your own query terms, Default: NULL

all.results

Find all results in query, Default: TRUE

force

Force is seldom wise, but sometimes..., Default: FALSE

remove.duplicates

Remove duplicates if TRUE, Default: TRUE

base.url

The base url for the Cristin API, Default: https://api.cristin.no/v2/results

custom.url

Define your own Cristin API url, Default: NULL

use.identifiers

Use if ISBN/DOI identifiers if enabled, Default: TRUE

use.multisession

Logical. If TRUE (default), parallel processing using multisession is employed; otherwise, processing is sequential.

min.multisession

Minimum number of results for using multisession. Default: 25

n.workers

Optional integer for the number of workers to be used in multisession mode. If NULL, it defaults to the number of available cores minus one (with a minimum of one).

handler

The progress handler to be used by the progressr package. If NULL and silent is FALSE, it defaults to "txtprogressbar". When silent is TRUE, the handler is set to "void".

restore.defaults

Logical. If TRUE (default), the current future plan is saved and restored upon exit.

zotero

A list with information on the specified Zotero library (e.g., id, API key, collections, and items), Default: NULL

zotero.import

Use CristinWrangler to wrangle metadata into an acceptable format for Zotero, Default: TRUE

zotero.check

Check for Cristin references already stored in Zotero, Default: TRUE

nvi

Filter out non-NVI publications Default: FALSE

remove.na

Cristin contains many, more or less, obscure categories, and not all are (yet) supported. By default these are removed, however, if this option is set to FALSE unsupported categories are treated according to replace.na, Default: TRUE

replace.na

May the odds be in your favor and replace unsupported categories with a predefined itemType if remove.na is set to false, Default: 'book'

force.type

Force all items to a predefined itemType, Default: NULL

silent

c2z is noisy, tell it to be quiet, Default: FALSE

log

A list for storing log elements, Default: list()

Value

A list with (exported) items from Cristin

Details

Please see #' https://oeysan.github.io/c2z/

Examples

# \donttest{
  # Simple `Cristin` search by id
  example <- Cristin(id = "840998")
#> Found 1 result 
#> Checking whether references are supported. See `CristinSupported()` 
#> Looking for missing data 
#> Sequential processing. Converting 1 item to Zotero format (began 16.03.2025 - 15:39:54) 
#> Duration: 00:00:45.926 (ended 16.03.2025 - 15:40:40) 

  # Print index using `ZoteroIndex`
  if (any(nrow(example$results))) {
    ZoteroIndex(example$results) |>
      dplyr::select(name) |>
      print(width = 80)
  }
#> # A tibble: 1 × 1
#>   name                                                                          
#>   <chr>                                                                         
#> 1 Petersen (2012) Seeds of Satan: Conceptions of Magic in Contemporary Satanism…
# }