Learn R Programming

openalexR (version 1.4.0)

oa_random: oa_fetch but for a random query

Description

oa_fetch but for a random query

Usage

oa_random(
  entity = oa_entities(),
  output = c("tibble", "dataframe", "list"),
  endpoint = "https://api.openalex.org"
)

Value

A data.frame or a list. One row or one element. Result of the random query. If you would like to select more than one random entity, say, 10, use `options = list(sample = 10)` argument in `oa_fetch`.

Arguments

entity

Character. Scholarly entity of the search. The argument can be one of c("works", "authors", "institutions", "concepts", "funders", "sources", "publishers", "topics"). If not provided, `entity` is guessed from `identifier`.

output

Character. Type of output, either a list or a tibble/data.frame.

endpoint

Character. URL of the OpenAlex Endpoint API server. Defaults to endpoint = "https://api.openalex.org".

Examples

Run this code
oa_random()

Run the code above in your browser using DataLab