Skip to contents

Fetches a protocol and records it as a Protocol resource.

Usage

krt_import_protocolsio(
  id,
  token = Sys.getenv("PROTOCOLSIO_TOKEN"),
  timeout = 30
)

Arguments

id

A protocols.io protocol id or DOI.

token

API token (defaults to PROTOCOLSIO_TOKEN).

timeout

Request timeout in seconds.

Value

A krt_tbl with a single Protocol resource.

Examples

# \donttest{
# Contacts the public protocols.io API. Offline, this warns and returns an
# empty table rather than failing.
k <- suppressWarnings(krt_import_protocolsio("kxygx3w"))
length(k$resources)
#> [1] 0
# }