knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

odyssey

R-CMD-check codecov

r-universe{.pkgdown-devel}

Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.

Access data and download documents from the Open Archive HAL. This package provides a programmatic access to the HAL API.

Installation

You can install the development version from GitHub with:

# install.packages("remotes")
remotes::install_github("nfrerebeau/odyssey")

Usage

The use of odyssey involves three steps. First, a standard query is created using hal_api(). Then, a set of functions allows to customize this query (see below). Finally, hal_search() and hal_download() allow to collect data and to download documents.

The following functions allow you to customize a query. They must be applied to the object returned by hal_api() and can be called in any order. hal_filter can be used several times to add multiple search filters. See the HAL search API documentation for a list of available fields.

## Load packages
library(odyssey)
library(magrittr) # pipes

Get the 10 most recent documents about archaeology of Celts in France:

## Topic selection
## Will be combined with AND
topic <- list("archéologie", "Celtes", "France")

## Search publications
hal_api() %>%
  hal_query(topic) %>%
  hal_select("title_s", "producedDate_tdate") %>%
  hal_filter("notice" %IN% "submitType_s") %>% 
  hal_sort("producedDate_tdate", decreasing = TRUE) %>%
  hal_search(limit = 10)

Get the most recent archaeological publication (in French) by journal:

hal_api() %>%
  hal_query("archéologie") %>%
  hal_select("producedDate_tdate") %>%
  hal_filter("ART" %IN% "docType_s") %>%
  hal_sort("producedDate_tdate", decreasing = TRUE) %>%
  hal_group(
    field = "journalTitle_s",
    sort = "producedDate_tdate", 
    decreasing = TRUE
  ) %>%
  hal_search(limit = 10)

Code of Conduct

Please note that the odyssey project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.



nfrerebeau/odyssey documentation built on March 30, 2022, 2:51 p.m.