Package 'nirs4alldatasets'

Title: Acquire Curated NIRS Reference Datasets ('nirs4all-datasets')
Description: R binding over the 'nirs4all-datasets' C 'ABI' ('n4ds_*'): resolve a dataset id from the distributable catalog index into a version-pinned download contract, fetch the canonical 'Parquet' ('Dataverse' / 'Zenodo' / 'figshare') with SHA-256 verification into a local cache, and re-verify a cached directory offline. JSON crosses the stable C 'ABI'; analysis of the data is left to the host.
Authors: Gregory Beurier [aut, cre]
Maintainer: Gregory Beurier <[email protected]>
License: MIT + file LICENSE
Version: 0.2.0
Built: 2026-06-12 17:41:43 UTC
Source: https://github.com/GBeurier/nirs4all-datasets

Help Index


The C ABI version string.

Description

The C ABI version string.

Usage

n4ds_abi_version()

Value

The C ABI version as a string.


Download + SHA-256-verify a resolved dataset into the cache (JSON status string).

Description

Download + SHA-256-verify a resolved dataset into the cache (JSON status string).

Usage

n4ds_fetch(resolved_json, opts_json = "")

Arguments

resolved_json

A resolved contract (from n4ds_resolve) as JSON.

opts_json

Options as JSON: {cache_dir?, token?, instance?, timeout_secs?}; "" for the defaults.

Value

The fetch status as a JSON string (dir, files:[{name, relpath, path, status}]).


Resolve a dataset id against an index JSON into its download contract (JSON string).

Description

Resolve a dataset id against an index JSON into its download contract (JSON string).

Usage

n4ds_resolve(index_json, dataset_id)

Arguments

index_json

The distributable catalog index as a JSON string.

dataset_id

The dataset id to resolve.

Value

The resolved download contract as a JSON string (id, tier, instance, doi, dataset_version, files, origins).


Re-verify a cached dataset directory against the contract's SHA-256s (JSON report).

Description

Re-verify a cached dataset directory against the contract's SHA-256s (JSON report).

Usage

n4ds_verify_cached(resolved_json, dir)

Arguments

resolved_json

A resolved contract as JSON.

dir

The cached dataset directory.

Value

The verification report as a JSON string (dir, ok, files:[{name, relpath, status}]).