Skip to contents

The function uses information stored in the `zotero` list to access specified collections and items in the Zotero library

Usage

ZoteroLibrary(
  zotero,
  case.insensitive = TRUE,
  ancestor = FALSE,
  recursive = FALSE,
  create = FALSE,
  limit = 100,
  start = 0,
  search.collections = TRUE,
  get.collections = TRUE,
  get.items = TRUE,
  item.type = NULL,
  all.results = TRUE,
  max.results = NULL,
  library.type = NULL,
  linkwrap = 1,
  style = "apa",
  locale = "en-US",
  force = FALSE,
  silent = FALSE
)

Arguments

zotero

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

case.insensitive

Disregard letter casing when searching for collections, Default: TRUE

ancestor

Trace the lineage of a collection (i.e., find the top-level collection), Default: FALSE

recursive

Find all nested collections, Default: FALSE

create

Create missing collections, Default: FALSE

limit

Number of results per query (max 100), Default: 100

start

Starting position of query (0 = first result), Default: 0

search.collections

Search all collections if collection.key fails, Default: TRUE

get.collections

Fetch collections, Default: TRUE

get.items

Fetch items, Default: TRUE

item.type

Items to search for (NULL = everything), Default: NULL

all.results

Find all results in query, Default: TRUE

max.results

Do you need a limit?, Default: NULL

library.type

Commma-separated data from Zotero (i.e., data, bib, citation), Default: NULL

linkwrap

Set URL (e.g., DOI) as HTML link (1 = yes), Default: 1

style

Citation style to use for appended bibliography and/or citations, Default: apa

locale

Desired language format of bibliography, Default: 'en-US'

force

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

silent

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

Value

A list with information on the specified Zotero library (e.g., collections and items)

Details

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

Examples

# \donttest{
  # Access the default group library
  example <- ZoteroLibrary(
    Zotero(
      user = FALSE,
      id = "4827927",
      api = "RqlAmlH5l1KPghfCseAq1sQ1"
    )
  )
#> Searching for collections 
#> Found 5 collections 
#> Searching for all items in library 
#> Found 3 items 
#> The Zotero list contains: 5 collections, 3 items, and 0 attachments 
  # Print index using `ZoteroIndex`
  if (any(nrow(example$items))) {
    ZoteroIndex(example$items) |>
      dplyr::select(name) |>
      print(width = 80)
  }
#> # A tibble: 3 × 1
#>   name                                                                          
#>   <chr>                                                                         
#> 1 Mishra et al. (2023) Exploring Active and Critical Engagement in Human-Robot …
#> 2 Somby & Stalheim (2023) Vygotsky med VR-briller                               
#> 3 Somby & Vik (2023) Vygotskys defektologi - et perspektiv på inkluderende oppl…
# }