| Title: | Access the Liking Rating Database |
| Version: | 0.2.2 |
| Description: | Download and work with the Liking Rating Database, a curated collection of subjective liking ratings from published decision-making studies, described in Fernandez, Goyal and Krajbich (2026) <doi:10.5281/zenodo.22216442>. Data is read from versioned release files and cached for the session, so a pinned version returns the same rows regardless of when it is run. Provides access by dataset, by item across studies, or as the whole corpus, together with the metadata and citations needed to report it. |
| License: | MIT + file LICENSE |
| Encoding: | UTF-8 |
| RoxygenNote: | 7.3.3 |
| Depends: | R (≥ 4.1) |
| Imports: | cli, fs, httr2, jsonlite, readr, tibble, tools |
| Suggests: | testthat (≥ 3.0.0) |
| Config/testthat/edition: | 3 |
| URL: | https://liking-rating-frontend.onrender.com, https://github.com/liking-initiative/likingInitiative-r |
| BugReports: | https://github.com/liking-initiative/likingInitiative-r/issues |
| NeedsCompilation: | no |
| Packaged: | 2026-09-22 19:57:00 UTC; kiante |
| Author: | Kianté Fernandez [aut, cre, cph] |
| Maintainer: | Kianté Fernandez <kiantefernan@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-10-02 10:50:07 UTC |
likingInitiative: the Liking Rating Database in R
Description
Subjective liking ratings from published decision-making studies.
Details
Data is read from versioned release files, so a pinned version returns the
same rows however long from now, and analyses keep working when the web
service does not. Downloads are cached in the session's temporary directory;
call use_persistent_cache() to keep them between sessions instead.
Two things to get right:
-
Cross-study comparisons must use
normalized_rating. Response scales differ between studies (0-4, 1-100, 1-870, willingness-to-pay in dollars), so rawratingvalues are not comparable.normalized_ratingis(rating - scale_min) / (scale_max - scale_min)and always lies in 0-1. -
Subject ids are unique only within a dataset. Subject
"12"in two datasets is two different people; key ondataset_codeandsubject_idtogether.
Author(s)
Maintainer: Kianté Fernandez kiantefernan@gmail.com [copyright holder]
See Also
Useful links:
BibTeX for a dataset's source publication
Description
BibTeX for a dataset's source publication
Usage
bibtex(x, ...)
Arguments
x |
A dataset from |
... |
Unused. |
Value
A character string holding a BibTeX entry.
Examples
bibtex(get_dataset("leeholyoak2021"))
Report on the local asset cache
Description
Shows where downloaded release files are kept, how much space they use, and which versions are present.
Usage
cache_info()
Value
A list, invisibly, with path, bytes and versions.
Examples
cache_info()
Citation text
Description
Please cite both the database and the study whose data you used.
Usage
cite(x, ...)
Arguments
x |
A dataset or item from |
... |
Unused. |
Value
A character string.
Examples
cite()
Delete cached release files
Description
Delete cached release files
Usage
clear_cache(version = NULL)
Arguments
version |
Version to remove. |
Value
Invisibly, the number of bytes freed.
Examples
clear_cache()
Download one or more datasets
Description
Reads a dataset's ratings from the release, with the metadata needed to interpret them.
Usage
get_dataset(dataset, version = "latest", timepoint = NULL)
Arguments
dataset |
A dataset code ( |
version |
Release version, or |
timepoint |
Optional rating phase to keep. |
Details
Two datasets repeat their rating phase – leeholyoak2021 (phases 1-3) and
leehare2023exp2 (phases 1-2). For those, subject_id and item_id
together are not unique; include timepoint, or pass the timepoint
argument to take a single phase.
Value
An object of class likingInitiative_dataset with elements data (a
tibble), metadata, dataset_code and version. For several datasets, a
named list of them.
Examples
d <- get_dataset("leeholyoak2021")
head(d$data)
d$metadata$rating_scale_max
cite(d)
One stimulus across every study that used it
Description
The cross-study view. Because the underlying studies use different response
scales, compare on normalized_rating, not rating.
Usage
get_item(item, version = "latest")
Arguments
item |
An item name, e.g. |
version |
Release version, or |
Details
Only the first rating phase of a repeated-phase dataset is included, so those studies do not carry extra weight in a cross-study comparison.
Value
An object of class likingInitiative_item with data, datasets and
version.
Examples
k <- get_item("kitkat")
k$data
List the datasets in the database
Description
timepoints gives the rating phases a dataset holds. All but two datasets
have a single phase; see get_dataset().
Usage
list_datasets(version = "latest")
Arguments
version |
Release version, or |
Value
A tibble with one row per dataset.
Examples
list_datasets()
List the stimuli in the database
Description
List the stimuli in the database
Usage
list_items(version = "latest")
Arguments
version |
Release version, or |
Value
A tibble with one row per item.
Examples
list_items()
List the publications in the database
Description
List the publications in the database
Usage
list_studies(version = "latest")
Arguments
version |
Release version, or |
Value
A tibble with one row per study.
Examples
list_studies()
The whole corpus in one call
Description
The whole corpus in one call
Usage
load_database(version = "latest")
Arguments
version |
Release version, or |
Value
A list of tibbles: ratings, studies, datasets, items. Held
in memory after the first call.
Examples
db <- load_database()
nrow(db$ratings)
Resolving a release version and fetching its assets
Description
The package reads versioned release files rather than a live service, so a pinned version returns the same rows however long from now, and analyses keep working when the web service does not.
Details
Assets come from Zenodo, which needs no credentials and mints a permanent
DOI per version. The package resolves the concept record – what Zenodo
calls "all versions" – so latest follows new releases without the
package itself needing an update.
Set the likingInitiative.release_dir option (or the LIKING_INITIATIVE_RELEASE_DIR
environment variable) to a directory built by scripts/build_release.py to
work against an unreleased build. The test suite uses this, so tests never
touch the network.
Version, date and headline counts for the release in use
Description
Version, date and headline counts for the release in use
Usage
release_info(version = "latest")
Arguments
version |
Release version, or |
Value
A list describing the release.
Examples
release_info()
Keep downloaded files between sessions
Description
By default release files are cached inside the session's temporary directory, so nothing is written outside it and the cache goes away when R exits. Call this to cache in a directory that persists instead, so a later session reuses the files rather than downloading them again.
Usage
use_persistent_cache(dir = tools::R_user_dir("likingInitiative", "cache"))
Arguments
dir |
Directory to cache in. Defaults to this package's per-user cache
directory, as given by |
Details
The choice lasts for the session. Put
likingInitiative::use_persistent_cache() in your .Rprofile to make it
the default for every session, and use clear_cache() to remove what it
has stored.
Value
The cache directory, invisibly.
Examples
# cache somewhere disposable for the rest of this session
use_persistent_cache(tempfile("likingInitiative-cache-"))