Learn R Programming

openesm: Access openESM datasets in R

The openesm package provides programmatic access to the openESM database, a collection of harmonized Experience Sampling Method (ESM) datasets (openesmdata.org). It enables researchers to discover, download, and work with ESM data while ensuring proper citation and license compliance.

Installation

Install the released version from CRAN:

install.packages("openesm")

Or install the development version from GitHub:

# install.packages("devtools")
devtools::install_github("openesm-project/openesm-r")

Usage

Discover datasets

library(openesm)

# List all available datasets
datasets <- list_datasets()
print(datasets)

# View specific dataset information
datasets[1, ]

Download data

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

# Access the data
head(data$data)

# View metadata
data$metadata

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

Citation and licensing

# Get citation information
cite(data)

# Additional notes
notes(data)

Cache management

# View cache information
cache_info()

# Clear cache
clear_cache()

Dataset Structure

Each dataset is returned as an S3 object containing:

  • data: A tibble with the ESM observations
  • metadata: List with dataset information including sample size, study design, and variable descriptions
  • dataset_id: Unique dataset identifier
  • version: Dataset version number

Data Citation

When using datasets from the openESM database, please cite the original publication(s) for a specific dataset. The cite() function provides properly formatted citations for both.

License

This package is licensed under the MIT License. Individual datasets may have different licenses - check the metadata for each dataset.

Contributing

Please report bugs and request features at https://github.com/openesm-project/openesm-r/issues.

Copy Link

Version

Install

install.packages('openesm')

Monthly Downloads

197

Version

0.1.2

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Björn S. Siepe

Last Published

December 3rd, 2025

Functions in openesm (0.1.2)

notes.openesm_dataset

Get additional notes for dataset
notes

Additional notes for openESM datasets
cite.openesm_dataset

Get citation information for dataset
clear_cache

Clear the openesm cache
print.openesm_dataset_list

Print method for a list of openesm_dataset objects
list_datasets

List available ESM datasets from openESM repository
print.openesm_dataset

S3 Methods for openesm objects Print method for openesm_dataset
cache_info

Display information about the openesm cache
get_dataset

Download ESM dataset(s) from openESM repository
cite

Citation information for openESM datasets
openesm-package

openesm: Access the Open Experience Sampling Method Database