search_orcid: Search ORCID

View source: R/search_orcid.R

search_orcidR Documentation

Search ORCID

Description

Search for ORCID based on people's names.

Usage

search_orcid(
  x,
  first.name = "FirstName",
  last.name = "LastName",
  middle.name = "MiddleName",
  orcid.name = "ORCID",
  keywords = NULL,
  rows = 20,
  clean = FALSE,
  save.names = TRUE
)

Arguments

x

a data frame containing at least two columns: first name and last name

first.name

character. The name of the column containing the first name. Defaults to "FirstName".

last.name

character. The name of the column containing the last name. Defaults to "LastName".

middle.name

character. The name of the column containing the middle name (optional). Defaults to "MiddleName"

orcid.name

character. The name of the column containing the ORCID number (optional). Defaults to "ORCID".

keywords

character. one or more keywords to filter the search output, in the case of two or more ORCIDs

rows

integer. The number of ORCID records to return, to be passed to function rorcid::orcid_search. Defaults to 20.

clean

logical. Should the function return only the exact name search? Defaults to FALSE.

save.names

logical. Should the people's names retrieved be returned as well? Defaults to TRUE.

Details

If only one researcher is found the function returns a sole ORCID. If there are two or more ORCID found, all ORCID are returned separated by a pipe (i.e. "|").

The arguments 'keywords' can be used to narrow down the search if multiple IDs are found. But it will only work if the reasearchers have included keywords in their ORCID records, which is not always the case (see examples).

In addition, if argument 'clean' is TRUE, it will exclude those IDs which are not exact matches, which can be useful to remove spurious hits. Also, you may want to increase the number of results returned by each query if the names provided are too common, to make sure that the name you are searching is indeed returned in the query.

By default, the function performs queries only for missing DOIs in the in the input column defined by orcid.name in the object x. It alsos returns two new columns containing the first and last names as retrieved in ORCID, but this option is controleed by the argument save.names.

The package rorcid which is used internally, requires an ORCID token or that the user starts a ORCID session and authorise the package, so it can query their API. So, make sure you have one of the options ready before using the function.

Value

the same input data frame with the missing (i.e. NA) ORCID, and optionally the corresponding names, if found.

Author(s)

Renato A. F. de Lima

Examples


## Not run: 
  # Single ORCID record with the name
  df <- data.frame(FirstName = "Nicolas", LastName = "Casajus")
  search_orcid(df)
  
  # Multiple ORCID entries
  df <- data.frame(FirstName = "Renato", LastName = "Lima")
  search_orcid(df)
  search_orcid(df, clean = TRUE)
  search_orcid(df, keywords = "ecology")

## End(Not run)   
  

FRBCesab/authoR documentation built on July 12, 2022, 6:04 a.m.