The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

Title: Access the Open Experience Sampling Method Database
Version: 0.1.0
Description: Provides programmatic access to the Open Experience Sampling Method ('openESM') database (https://openesmdata.org), a collection of harmonized experience sampling datasets. The package enables researchers to discover, download, and work with the datasets while ensuring proper citation and license compliance.
License: MIT + file LICENSE
Encoding: UTF-8
RoxygenNote: 7.3.3
Imports: cli (≥ 3.6.0), fs, httr2, jsonlite, readr, purrr, dplyr, tibble, zen4R
Depends: R (≥ 4.1.0)
Suggests: testthat (≥ 3.0.0)
Config/testthat/edition: 3
URL: https://github.com/openesm-project/openesm-r
BugReports: https://github.com/openesm-project/openesm-r/issues
NeedsCompilation: no
Packaged: 2025-10-25 06:24:36 UTC; Bjoern
Author: Björn S. Siepe ORCID iD [aut, cre, cph], Matthias Kloft ORCID iD [aut]
Maintainer: Björn S. Siepe <bjoernsiepe@gmail.com>
Repository: CRAN
Date/Publication: 2025-10-29 20:00:07 UTC

openesm: Access the Open Experience Sampling Method Database

Description

Provides programmatic access to the Open Experience Sampling Method ('openESM') database (https://openesmdata.org), a collection of harmonized experience sampling datasets. The package enables researchers to discover, download, and work with the datasets while ensuring proper citation and license compliance.

Author(s)

Maintainer: Björn S. Siepe bjoernsiepe@gmail.com (ORCID) [copyright holder]

Authors:

See Also

Useful links:


Display information about the openesm cache

Description

Shows the location and total size of the local file cache.

Usage

cache_info()

Value

Invisibly returns NULL.

Examples


# view cache information
cache_info()


Citation information for openESM datasets

Description

Citation information for openESM datasets

Usage

cite(x, ...)

Arguments

x

An object of class openesm_dataset.

...

Additional arguments passed to methods

Value

Citation information for the dataset(s)

Examples


# Get citation for a dataset
dataset <- get_dataset("0001")
cite(dataset)


Get citation information for dataset

Description

Get citation information for dataset

Usage

## S3 method for class 'openesm_dataset'
cite(x, format = "bibtex", ...)

Arguments

x

An object of class openesm_dataset.

format

Character string specifying citation format. Currently only "bibtex" is supported.

...

Additional arguments (currently unused).

Value

Character string with citation information, returned invisibly.

Examples


dataset <- get_dataset("0001")
cite(dataset)


Clear the openesm cache

Description

Removes all cached openesm data from your local machine.

Usage

clear_cache(force = FALSE)

Arguments

force

Logical. If TRUE, will not ask for confirmation before deleting. Default is FALSE.

Value

Invisibly returns NULL.

Examples


# clear cache with confirmation prompt
if(interactive()) {
 clear_cache()
}

# force clear without confirmation
clear_cache(force = TRUE)


Download ESM dataset(s) from openESM repository

Description

Downloads one or more Experience Sampling Method (ESM) datasets from the openESM repository hosted on Zenodo. Returns an S3 object containing the dataset and associated metadata.

Usage

get_dataset(
  dataset_id,
  version = "latest",
  cache = TRUE,
  path = NULL,
  force_download = FALSE,
  sandbox = FALSE,
  quiet = FALSE,
  max_attempts = 15,
  ...
)

Arguments

dataset_id

Character string or vector of dataset IDs. Use list_datasets() to see available datasets.

version

Character string specifying the dataset version. Default is "latest" which downloads the most recent version.

cache

Logical. If TRUE (default), uses cached version if available and not expired.

path

Character string specifying custom download path. If NULL (default), files are cached in the user's cache directory.

force_download

Logical. If TRUE, forces re-download even if cached version exists. Default is FALSE.

sandbox

Logical. If TRUE, uses Zenodo sandbox environment for testing. Default is FALSE.

quiet

Logical. If TRUE, suppresses informational messages. Default is FALSE.

max_attempts

Integer, maximum number of retry attempts for Zenodo API calls. Default is 15.

...

Additional arguments passed to list_datasets(). This includes metadata_version to specify the metadata catalog version.

Details

This function downloads ESM datasets from Zenodo using DOIs stored in the openESM metadata repository. Datasets are cached locally to avoid repeated downloads. Use force_download = TRUE to refresh cached data.

The function handles both individual datasets and batch downloads. When downloading multiple datasets, progress is shown for each download.

Value

For single dataset: An S3 object of class openesm_dataset containing:

For multiple datasets: An S3 object of class openesm_dataset_list containing a named list of openesm_dataset objects.

See Also

list_datasets() for available datasets, cite() for citation information

Examples


# List available datasets first
available <- list_datasets()
head(available)

# Download a single dataset
dataset <- get_dataset("0001")

# Access the data
head(dataset$data)

# View metadata and provenance information
dataset$metadata
dataset$dataset_version  # Dataset version
dataset$metadata_version # Metadata catalog version

# Download multiple datasets
datasets <- get_dataset(c("0001", "0002"))

# Access individual datasets from the list
datasets[["0001"]]$data

# Use specific metadata catalog version
dataset_v1 <- get_dataset("0001", metadata_version = "1.0.0")

# Force re-download to get latest version
dataset_fresh <- get_dataset("0001", force_download = TRUE)




List available ESM datasets from openESM repository

Description

Retrieves a list of available Experience Sampling Method (ESM) datasets from the openESM metadata repository. Returns a tibble with dataset information and metadata that can be used with get_dataset().

Usage

list_datasets(cache_hours = 24, metadata_version = "latest", max_attempts = 15)

Arguments

cache_hours

Numeric. Number of hours to consider the cached dataset index valid. Default is 24. Set to 0 to force fresh download.

metadata_version

Character string specifying the metadata catalog version. Default is "latest" which downloads the most recent version.

max_attempts

Integer, maximum number of retry attempts for Zenodo API calls. Default is 15.

Details

This function downloads and caches a master index of available datasets from the openESM metadata repository, which is hosted on Zenodo. The index is cached locally to avoid repeated downloads. Use cache_hours = 0 to force a fresh download of the index.

The returned tibble can be filtered and explored to identify datasets of interest before downloading with get_dataset().

Value

A tibble with one row per dataset containing:

See Also

get_dataset() to download specific datasets

Examples


# Get list of all available datasets
datasets <- list_datasets()

# Force fresh download of index
fresh_list <- list_datasets(cache_hours = 0)

# Use specific metadata version
datasets_v1 <- list_datasets(metadata_version = "1.0.0")

# Use dataset IDs with get_dataset()
dataset <- get_dataset(datasets$dataset_id[1])



Additional notes for openESM datasets

Description

Additional notes for openESM datasets

Usage

notes(x, ...)

Arguments

x

An object of class openesm_dataset.

...

Additional arguments passed to methods

Value

Additional notes and information about the dataset(s)

Examples


# Get notes for a dataset
dataset <- get_dataset("0001")
notes(dataset)


Get additional notes for dataset

Description

Get additional notes for dataset

Usage

## S3 method for class 'openesm_dataset'
notes(x, ...)

Arguments

x

An object of class openesm_dataset.

...

Additional arguments (currently unused).

Value

Character vector with dataset notes, returned invisibly.

Examples


dataset <- get_dataset("0001")
notes(dataset)


S3 Methods for openesm objects Print method for openesm_dataset

Description

S3 Methods for openesm objects Print method for openesm_dataset

Usage

## S3 method for class 'openesm_dataset'
print(x, ...)

Arguments

x

An object of class openesm_dataset.

...

Additional arguments (currently unused).

Value

Invisibly returns the original object.

Examples


dataset <- get_dataset("0001")
print(dataset)


Print method for a list of openesm_dataset objects

Description

Print method for a list of openesm_dataset objects

Usage

## S3 method for class 'openesm_dataset_list'
print(x, ...)

Arguments

x

An object of class openesm_dataset_list.

...

Additional arguments (currently unused).

Value

Invisibly returns the original object.

Examples


datasets <- get_dataset(c("0001", "0002"))
print(datasets)

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.